/** Copyright (C) 2011  Jan-Willem de Bruyn
 *
 *    This program is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *     (at your option) any later version.
 * 
 *     This program is distributed in the hope that it will be useful,
 *     but WITHOUT ANY WARRANTY; without even the implied warranty of
 *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *     GNU General Public License for more details.
 * 
 *     You should have received a copy of the GNU General Public License
 *     along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
import java.util.Random;
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
import javax.microedition.lcdui.StringItem;
import org.netbeans.microedition.lcdui.WaitScreen;
import org.netbeans.microedition.util.SimpleCancellableTask;
import java.io.*;
import javax.microedition.io.file.*;
import javax.microedition.rms.*;

/**
 * @author psyonity
 * @tester Corstian Boerman
 */
public class thegame extends MIDlet implements CommandListener {
    //<editor-fold defaultstate="collapsed" desc="variables ">
    public int XP;
    private boolean midletPaused = false;
    public int LVL = 1;
    public int HP = 10;
    public String HPSTR;
    public int SP = 10;
    public int TP = 10;
    public int MAXHP = 10;
    public int MAXSP = 10;
    public int MAXTP = 10;
    public int GOLD = 100;
    public int INNPRICE;
    public String INNPRICESTR;
    public String currtown;
    public int BANKAMOUNT;
    public int BANK;
    public int GOLDFOUND;
    public int townnum = 0;
    public int MAGONIINN = 10;
    public int TIMMINN = 5;
    public int magoniin;
    public int SLIMEHP = 5;
    public String mobstr = null;
    public int list1num;
    public int MAXSLIMEHP = 10;
    public int SLIMEXP;
    public int XPNEEDED;
    public int MOBMINHP;
    public int MEMINHP;
    public int MOBGOLD;
    public int MEGOLD;
    public int ATTACK = 5;
    public int WEAPONATTACK = 2;
    public String WEAPON;
    public FileConnection connection;
    public String path;
    public String filename;
    public String url;
    public int listnum;
    public int LVLS;
    public String weapon1str = "dagger";
    public String weapon2str = "small sword";
    public String weapon3str = "large sword";
    public String weapon4str = "master sword";
    public String weapon5str = "ultimate sword";
    public String weapon6str = "child bow";
public String weapon7str = "normal bow";
public String weapon8str = "oak bow";
public String weapon9str = "willow bow";
public String weapon10str = "yew bow";
public int weapon1price = 10;
public int weapon2price = 50;
public int weapon3price = 100;
public int weapon4price = 500;
public int weapon5price = 1000;
public int weapon6price = 10;
public int weapon7price = 50;
public int weapon8price = 100;
public int weapon9price = 500;
public int weapon10price = 1000;
public int weapon1attack = 6;
public int weapon2attack = 10;
public int weapon3attack = 15;
public int weapon4attack = 30;
public int weapon5attack = 50;
public int weapon6attack = 6;
public int weapon7attack = 10;
public int weapon8attack = 15;
public int weapon9attack = 30;
public int weapon10attack = 50;
public String defence1str = "wooden kite shield";
public String defence2str = "stonen kite shield";
public String defence3str = "metal kite shield";
public String defence4str = "diamond kite shield";
public String defence5str = "titanium kite shield";
public String defence6str = "wooden sq shield";
public String defence7str = "stonen sq shield";
public String defence8str = "metal sq shield";
public String defence9str = "diamond sq shield";
public String defence10str = "titanium sq shield";
public int defence1price = 10;
public int defence2price = 50;
public int defence3price = 100;
public int defence4price = 500;
public int defence5price = 1000;
public int defence6price = 10;
public int defence7price = 50;
public int defence8price = 100;
public int defence9price = 500;
public int defence10price = 1000;
public int defence1attack = 6;
public int defence2attack = 10;
public int defence3attack = 15;
public int defence4attack = 30;
public int defence5attack = 50;
public int defence6attack = 6;
public int defence7attack = 10;
public int defence8attack = 15;
public int defence9attack = 30;
public int defence10attack = 50;
public int SAVESLOT;
public int DEFENCE = 10;
public int MOBATTACK;
public int HEALSP = 5;
public int DOUBLEATTACKSP = 10;
public int GROUNDSMASHSP = 15;
public int HEAL = 5;
public int DOUBLEATTACK = 10;
public int GROUNDSMASH = 20;
public int NORMALATTACK = 5;
public int HEAVYATTACK = 10;
public int NORMALDEFENCE = 10;
public int HEAVYDEFENCE = 5;
//<editor-fold defaultstate="collapsed" desc=" Generated Fields ">//GEN-BEGIN:|fields|0|
private List townactions;
private Form form;
private ChoiceGroup choiceGroup;
private StringItem stringItem3;
private Form form1;
private StringItem stringItem;
private Form form2;
private StringItem stringItem1;
private StringItem stringItem2;
private TextField textField1;
private WaitScreen waitScreen;
private WaitScreen waitScreen1;
private WaitScreen waitScreen2;
private WaitScreen waitScreen3;
private WaitScreen waitScreen4;
private Form form3;
private StringItem stringItem4;
private Form form6;
private WaitScreen waitScreen7;
private WaitScreen waitScreen8;
private WaitScreen waitScreen9;
private WaitScreen waitScreen10;
private List list1;
private WaitScreen waitScreen12;
private WaitScreen waitScreen11;
private WaitScreen waitScreen13;
private List list2;
private WaitScreen waitScreen16;
private WaitScreen waitScreen14;
private WaitScreen waitScreen15;
private WaitScreen waitScreen18;
private WaitScreen waitScreen19;
private List list3;
private WaitScreen waitScreen17;
private List list5;
private WaitScreen waitScreen20;
private List list4;
private WaitScreen waitScreen21;
private List list7;
private WaitScreen waitScreen6;
private WaitScreen waitScreen5;
private List list6;
private WaitScreen waitScreen23;
private List list8;
private WaitScreen waitScreen22;
private List list9;
private WaitScreen waitScreen24;
private Alert alert2;
private WaitScreen waitScreen25;
private List list;
private WaitScreen waitScreen26;
private Command okCommand;
private Command okCommand1;
private Command deposit;
private Command backtocenter;
private Command withdraw;
private Command exitCommand;
private Command exit;
private Command rumors;
private Command exit1;
private Command town;
private Command stopCommand;
private Command attack;
private Command exitCommand1;
private Command stopCommand1;
private Command backCommand;
private Command select;
private Command saveload;
private Command okCommand2;
private Command Battle;
private Command okCommand3;
private Command Skill;
private Command exitCommand3;
private Command exitCommand2;
private Command helpCommand;
private Command okCommand4;
private Command backCommand1;
private Command exitCommand4;
private SimpleCancellableTask task1;
private SimpleCancellableTask task2;
private SimpleCancellableTask task;
private SimpleCancellableTask task3;
private SimpleCancellableTask task4;
private SimpleCancellableTask task7;
private SimpleCancellableTask task8;
private SimpleCancellableTask task11;
private SimpleCancellableTask task10;
private SimpleCancellableTask task12;
private SimpleCancellableTask task14;
private SimpleCancellableTask task13;
private SimpleCancellableTask task15;
private SimpleCancellableTask task16;
private SimpleCancellableTask task19;
private SimpleCancellableTask task18;
private SimpleCancellableTask task20;
private SimpleCancellableTask task17;
private SimpleCancellableTask task21;
private SimpleCancellableTask task9;
private SimpleCancellableTask task6;
private SimpleCancellableTask task5;
private SimpleCancellableTask task23;
private SimpleCancellableTask task22;
private SimpleCancellableTask task24;
private SimpleCancellableTask task25;
private SimpleCancellableTask task26;
//</editor-fold>//GEN-END:|fields|0|

//</editor-fold>
    /**
     * The thegame constructor.
     */
    public thegame() {
    }
    //<editor-fold defaultstate="collapsed" desc=" Generated Methods ">//GEN-BEGIN:|methods|0|
    //</editor-fold>//GEN-END:|methods|0|

    //<editor-fold defaultstate="collapsed" desc=" Generated Method: initialize ">//GEN-BEGIN:|0-initialize|0|0-preInitialize
    /**
     * Initilizes the application.
     * It is called only once when the MIDlet is started. The method is called before the <code>startMIDlet</code> method.
     */
    private void initialize() {//GEN-END:|0-initialize|0|0-preInitialize
        // write pre-initialize user code here
        stringItem = new StringItem("stringItem", null);//GEN-BEGIN:|0-initialize|1|0-postInitialize
        stringItem1 = new StringItem("Bank", "");
        stringItem2 = new StringItem("Gold", "");
        form2 = new Form("form2", new Item[] { stringItem1, stringItem2, getTextField1() });
        form2.addCommand(getDeposit());
        form2.addCommand(getBacktocenter());
        form2.addCommand(getWithdraw());
        form2.setCommandListener(this);
        stringItem4 = new StringItem("", null, Item.PLAIN);
        stringItem4.setLayout(ImageItem.LAYOUT_DEFAULT);
        list1 = new List("list1", Choice.IMPLICIT);
        list1.addCommand(getAttack());
        list1.addCommand(getSkill());
        list1.addCommand(getExitCommand1());
        list1.setCommandListener(this);
        okCommand = new Command("Ok", Command.OK, 0);
        okCommand1 = new Command("Ok", Command.OK, 0);
        rumors = new Command("rumors", Command.HELP, 0);
        town = new Command("town", Command.OK, 1);
        stopCommand = new Command("Stop", Command.STOP, 1);//GEN-END:|0-initialize|1|0-postInitialize
        // write post-initialize user code here

    }//GEN-BEGIN:|0-initialize|2|
    //</editor-fold>//GEN-END:|0-initialize|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Method: startMIDlet ">//GEN-BEGIN:|3-startMIDlet|0|3-preAction
    /**
     * Performs an action assigned to the Mobile Device - MIDlet Started point.
     */
    public void startMIDlet() {//GEN-END:|3-startMIDlet|0|3-preAction
        // write pre-action user code here
        switchDisplayable(null, getList2());//GEN-LINE:|3-startMIDlet|1|3-postAction
        // write post-action user code here
    }//GEN-BEGIN:|3-startMIDlet|2|
    //</editor-fold>//GEN-END:|3-startMIDlet|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Method: resumeMIDlet ">//GEN-BEGIN:|4-resumeMIDlet|0|4-preAction
    /**
     * Performs an action assigned to the Mobile Device - MIDlet Resumed point.
     */
    public void resumeMIDlet() {//GEN-END:|4-resumeMIDlet|0|4-preAction
        // write pre-action user code here
//GEN-LINE:|4-resumeMIDlet|1|4-postAction
        // write post-action user code here
    }//GEN-BEGIN:|4-resumeMIDlet|2|
    //</editor-fold>//GEN-END:|4-resumeMIDlet|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Method: switchDisplayable ">//GEN-BEGIN:|5-switchDisplayable|0|5-preSwitch
    /**
     * Switches a current displayable in a display. The <code>display</code> instance is taken from <code>getDisplay</code> method. This method is used by all actions in the design for switching displayable.
     * @param alert the Alert which is temporarily set to the display; if <code>null</code>, then <code>nextDisplayable</code> is set immediately
     * @param nextDisplayable the Displayable to be set
     */
    public void switchDisplayable(Alert alert, Displayable nextDisplayable) {//GEN-END:|5-switchDisplayable|0|5-preSwitch
        // write pre-switch user code here
        Display display = getDisplay();//GEN-BEGIN:|5-switchDisplayable|1|5-postSwitch
        if (alert == null) {
            display.setCurrent(nextDisplayable);
        } else {
            display.setCurrent(alert, nextDisplayable);
        }//GEN-END:|5-switchDisplayable|1|5-postSwitch
        // write post-switch user code here
    }//GEN-BEGIN:|5-switchDisplayable|2|
    //</editor-fold>//GEN-END:|5-switchDisplayable|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Method: commandAction for Displayables ">//GEN-BEGIN:|7-commandAction|0|7-preCommandAction
    /**
     * Called by a system to indicated that a command has been invoked on a particular displayable.
     * @param command the Command that was invoked
     * @param displayable the Displayable where the command was invoked
     */
    public void commandAction(Command command, Displayable displayable) {//GEN-END:|7-commandAction|0|7-preCommandAction
        // write pre-action user code here
        if (displayable == form) {//GEN-BEGIN:|7-commandAction|1|138-preAction
            if (command == exit) {//GEN-END:|7-commandAction|1|138-preAction
                // write pre-action user code here
                switchDisplayable(null, getTownactions());//GEN-LINE:|7-commandAction|2|138-postAction
                // write post-action user code here
            } else if (command == okCommand) {//GEN-LINE:|7-commandAction|3|27-preAction
                // write pre-action user code here
                if (choiceGroup.isSelected(0)) {
                HP = MAXHP;
                SP = MAXSP;
                TP = MAXTP;
                GOLD = GOLD-INNPRICE;
                }
                switchDisplayable(null, getWaitScreen3());//GEN-LINE:|7-commandAction|4|27-postAction
                // write post-action user code here
            } else if (command == rumors) {//GEN-LINE:|7-commandAction|5|131-preAction
                // write pre-action user code here
                switchDisplayable(null, getWaitScreen4());//GEN-LINE:|7-commandAction|6|131-postAction
                // write post-action user code here
            }//GEN-BEGIN:|7-commandAction|7|384-preAction
        } else if (displayable == form1) {
            if (command == Battle) {//GEN-END:|7-commandAction|7|384-preAction
                // write pre-action user code here
                switchDisplayable(null, getWaitScreen9());//GEN-LINE:|7-commandAction|8|384-postAction
                // write post-action user code here
            } else if (command == okCommand1) {//GEN-LINE:|7-commandAction|9|66-preAction
                // write pre-action user code here
                switchDisplayable(null, getWaitScreen7());//GEN-LINE:|7-commandAction|10|66-postAction
                // write post-action user code here
            } else if (command == stopCommand1) {//GEN-LINE:|7-commandAction|11|269-preAction
                // write pre-action user code here
                switchDisplayable(null, getTownactions());//GEN-LINE:|7-commandAction|12|269-postAction
                // write post-action user code here
            }//GEN-BEGIN:|7-commandAction|13|82-preAction
        } else if (displayable == form2) {
            if (command == backtocenter) {//GEN-END:|7-commandAction|13|82-preAction
                // write pre-action user code here
                switchDisplayable(null, getTownactions());//GEN-LINE:|7-commandAction|14|82-postAction
                // write post-action user code here
            } else if (command == deposit) {//GEN-LINE:|7-commandAction|15|79-preAction
                // write pre-action user code here

                switchDisplayable(null, getWaitScreen());//GEN-LINE:|7-commandAction|16|79-postAction
                // write post-action user code here
            } else if (command == withdraw) {//GEN-LINE:|7-commandAction|17|100-preAction
                // write pre-action user code here
                switchDisplayable(null, getWaitScreen1());//GEN-LINE:|7-commandAction|18|100-postAction
                // write post-action user code here
            }//GEN-BEGIN:|7-commandAction|19|135-preAction
        } else if (displayable == form3) {
            if (command == exit1) {//GEN-END:|7-commandAction|19|135-preAction
                // write pre-action user code here
                switchDisplayable(null, getForm());//GEN-LINE:|7-commandAction|20|135-postAction
                // write post-action user code here
            }//GEN-BEGIN:|7-commandAction|21|191-preAction
        } else if (displayable == form6) {
            if (command == town) {//GEN-END:|7-commandAction|21|191-preAction
                // write pre-action user code here
                switchDisplayable(null, getTownactions());//GEN-LINE:|7-commandAction|22|191-postAction
                // write post-action user code here
            }//GEN-BEGIN:|7-commandAction|23|498-preAction
        } else if (displayable == list) {
            if (command == List.SELECT_COMMAND) {//GEN-END:|7-commandAction|23|498-preAction
                // write pre-action user code here
                listAction();//GEN-LINE:|7-commandAction|24|498-postAction
                // write post-action user code here
            } else if (command == exitCommand4) {//GEN-LINE:|7-commandAction|25|507-preAction
                // write pre-action user code here
                switchDisplayable(null, getTownactions());//GEN-LINE:|7-commandAction|26|507-postAction
                // write post-action user code here
            }//GEN-BEGIN:|7-commandAction|27|227-preAction
        } else if (displayable == list1) {
            if (command == List.SELECT_COMMAND) {//GEN-END:|7-commandAction|27|227-preAction
                // write pre-action user code here
                list1Action();//GEN-LINE:|7-commandAction|28|227-postAction
                // write post-action user code here
            } else if (command == Skill) {//GEN-LINE:|7-commandAction|29|442-preAction
                // write pre-action user code here
                switchDisplayable(null, getList8());//GEN-LINE:|7-commandAction|30|442-postAction
                // write post-action user code here
            } else if (command == attack) {//GEN-LINE:|7-commandAction|31|233-preAction
                // write pre-action user code here
                switchDisplayable(null, getWaitScreen10());//GEN-LINE:|7-commandAction|32|233-postAction
                // write post-action user code here
            } else if (command == exitCommand1) {//GEN-LINE:|7-commandAction|33|242-preAction
                // write pre-action user code here
                switchDisplayable(null, getWaitScreen11());//GEN-LINE:|7-commandAction|34|242-postAction
                // write post-action user code here
            }//GEN-BEGIN:|7-commandAction|35|285-preAction
        } else if (displayable == list2) {
            if (command == List.SELECT_COMMAND) {//GEN-END:|7-commandAction|35|285-preAction
                // write pre-action user code here
                list2Action();//GEN-LINE:|7-commandAction|36|285-postAction
                // write post-action user code here
            } else if (command == exitCommand3) {//GEN-LINE:|7-commandAction|37|439-preAction
                // write pre-action user code here
                exitMIDlet();//GEN-LINE:|7-commandAction|38|439-postAction
                // write post-action user code here
            }//GEN-BEGIN:|7-commandAction|39|327-preAction
        } else if (displayable == list3) {
            if (command == List.SELECT_COMMAND) {//GEN-END:|7-commandAction|39|327-preAction
                // write pre-action user code here
                list3Action();//GEN-LINE:|7-commandAction|40|327-postAction
                // write post-action user code here
            } else if (command == okCommand2) {//GEN-LINE:|7-commandAction|41|332-preAction
                // write pre-action user code here
                switchDisplayable(null, getWaitScreen17());//GEN-LINE:|7-commandAction|42|332-postAction
                // write post-action user code here
            }//GEN-BEGIN:|7-commandAction|43|364-preAction
        } else if (displayable == list4) {
            if (command == List.SELECT_COMMAND) {//GEN-END:|7-commandAction|43|364-preAction
                // write pre-action user code here
                list4Action();//GEN-LINE:|7-commandAction|44|364-postAction
                // write post-action user code here
            }//GEN-BEGIN:|7-commandAction|45|369-preAction
        } else if (displayable == list5) {
            if (command == List.SELECT_COMMAND) {//GEN-END:|7-commandAction|45|369-preAction
                // write pre-action user code here
                list5Action();//GEN-LINE:|7-commandAction|46|369-postAction
                // write post-action user code here
            }//GEN-BEGIN:|7-commandAction|47|391-preAction
        } else if (displayable == list6) {
            if (command == List.SELECT_COMMAND) {//GEN-END:|7-commandAction|47|391-preAction
                // write pre-action user code here
                list6Action();//GEN-LINE:|7-commandAction|48|391-postAction
                // write post-action user code here
            } else if (command == okCommand3) {//GEN-LINE:|7-commandAction|49|398-preAction
                // write pre-action user code here
                switchDisplayable(null, getWaitScreen6());//GEN-LINE:|7-commandAction|50|398-postAction
                // write post-action user code here
            }//GEN-BEGIN:|7-commandAction|51|408-preAction
        } else if (displayable == list7) {
            if (command == List.SELECT_COMMAND) {//GEN-END:|7-commandAction|51|408-preAction
                // write pre-action user code here
                list7Action();//GEN-LINE:|7-commandAction|52|408-postAction
                // write post-action user code here
            } else if (command == exitCommand2) {//GEN-LINE:|7-commandAction|53|418-preAction
                // write pre-action user code here
                switchDisplayable(null, getWaitScreen22());//GEN-LINE:|7-commandAction|54|418-postAction
                // write post-action user code here
            }//GEN-BEGIN:|7-commandAction|55|448-preAction
        } else if (displayable == list8) {
            if (command == List.SELECT_COMMAND) {//GEN-END:|7-commandAction|55|448-preAction
                // write pre-action user code here
                list8Action();//GEN-LINE:|7-commandAction|56|448-postAction
                // write post-action user code here
            }//GEN-BEGIN:|7-commandAction|57|473-preAction
        } else if (displayable == list9) {
            if (command == List.SELECT_COMMAND) {//GEN-END:|7-commandAction|57|473-preAction
                // write pre-action user code here
                list9Action();//GEN-LINE:|7-commandAction|58|473-postAction
                // write post-action user code here
            } else if (command == backCommand1) {//GEN-LINE:|7-commandAction|59|491-preAction
                // write pre-action user code here
                switchDisplayable(null, getTownactions());//GEN-LINE:|7-commandAction|60|491-postAction
                // write post-action user code here
            } else if (command == helpCommand) {//GEN-LINE:|7-commandAction|61|477-preAction
                // write pre-action user code here
                switchDisplayable(getAlert2(), getList9());//GEN-LINE:|7-commandAction|62|477-postAction
                // write post-action user code here
            }//GEN-BEGIN:|7-commandAction|63|16-preAction
        } else if (displayable == townactions) {
            if (command == List.SELECT_COMMAND) {//GEN-END:|7-commandAction|63|16-preAction
                // write pre-action user code here
                townactionsAction();//GEN-LINE:|7-commandAction|64|16-postAction
                // write post-action user code here
            } else if (command == exitCommand) {//GEN-LINE:|7-commandAction|65|118-preAction
                // write pre-action user code here
                switchDisplayable(null, getList2());//GEN-LINE:|7-commandAction|66|118-postAction
                // write post-action user code here
            }//GEN-BEGIN:|7-commandAction|67|94-preAction
        } else if (displayable == waitScreen) {
            if (command == WaitScreen.FAILURE_COMMAND) {//GEN-END:|7-commandAction|67|94-preAction
                // write pre-action user code here
                switchDisplayable(null, form2);//GEN-LINE:|7-commandAction|68|94-postAction
                // write post-action user code here
            } else if (command == WaitScreen.SUCCESS_COMMAND) {//GEN-LINE:|7-commandAction|69|93-preAction
                // write pre-action user code here
                switchDisplayable(null, form2);//GEN-LINE:|7-commandAction|70|93-postAction
                // write post-action user code here
            }//GEN-BEGIN:|7-commandAction|71|103-preAction
        } else if (displayable == waitScreen1) {
            if (command == WaitScreen.FAILURE_COMMAND) {//GEN-END:|7-commandAction|71|103-preAction
                // write pre-action user code here
                switchDisplayable(null, form2);//GEN-LINE:|7-commandAction|72|103-postAction
                // write post-action user code here
            } else if (command == WaitScreen.SUCCESS_COMMAND) {//GEN-LINE:|7-commandAction|73|102-preAction
                // write pre-action user code here
                switchDisplayable(null, form2);//GEN-LINE:|7-commandAction|74|102-postAction
                // write post-action user code here
            }//GEN-BEGIN:|7-commandAction|75|236-preAction
        } else if (displayable == waitScreen10) {
            if (command == WaitScreen.FAILURE_COMMAND) {//GEN-END:|7-commandAction|75|236-preAction
                // write pre-action user code here
                switchDisplayable(null, list1);//GEN-LINE:|7-commandAction|76|236-postAction
                // write post-action user code here
            } else if (command == WaitScreen.SUCCESS_COMMAND) {//GEN-LINE:|7-commandAction|77|235-preAction
                // write pre-action user code here
                switchDisplayable(null, list1);//GEN-LINE:|7-commandAction|78|235-postAction
                // write post-action user code here
            }//GEN-BEGIN:|7-commandAction|79|248-preAction
        } else if (displayable == waitScreen11) {
            if (command == WaitScreen.FAILURE_COMMAND) {//GEN-END:|7-commandAction|79|248-preAction
                // write pre-action user code here
                switchDisplayable(null, getWaitScreen12());//GEN-LINE:|7-commandAction|80|248-postAction
                // write post-action user code here
            } else if (command == WaitScreen.SUCCESS_COMMAND) {//GEN-LINE:|7-commandAction|81|247-preAction
                // write pre-action user code here
                switchDisplayable(null, getWaitScreen12());//GEN-LINE:|7-commandAction|82|247-postAction
                // write post-action user code here
            }//GEN-BEGIN:|7-commandAction|83|255-preAction
        } else if (displayable == waitScreen12) {
            if (command == WaitScreen.FAILURE_COMMAND) {//GEN-END:|7-commandAction|83|255-preAction
                // write pre-action user code here
                switchDisplayable(null, getTownactions());//GEN-LINE:|7-commandAction|84|255-postAction
                // write post-action user code here
            } else if (command == WaitScreen.SUCCESS_COMMAND) {//GEN-LINE:|7-commandAction|85|254-preAction
                // write pre-action user code here
                switchDisplayable(null, getTownactions());//GEN-LINE:|7-commandAction|86|254-postAction
                // write post-action user code here
            }//GEN-BEGIN:|7-commandAction|87|279-preAction
        } else if (displayable == waitScreen13) {
            if (command == WaitScreen.FAILURE_COMMAND) {//GEN-END:|7-commandAction|87|279-preAction
                // write pre-action user code here
                switchDisplayable(null, getTownactions());//GEN-LINE:|7-commandAction|88|279-postAction
                // write post-action user code here
            } else if (command == WaitScreen.SUCCESS_COMMAND) {//GEN-LINE:|7-commandAction|89|278-preAction
                // write pre-action user code here
                switchDisplayable(null, getTownactions());//GEN-LINE:|7-commandAction|90|278-postAction
                // write post-action user code here
            }//GEN-BEGIN:|7-commandAction|91|291-preAction
        } else if (displayable == waitScreen14) {
            if (command == WaitScreen.FAILURE_COMMAND) {//GEN-END:|7-commandAction|91|291-preAction
                // write pre-action user code here
                switchDisplayable(null, getWaitScreen12());//GEN-LINE:|7-commandAction|92|291-postAction
                // write post-action user code here
            } else if (command == WaitScreen.SUCCESS_COMMAND) {//GEN-LINE:|7-commandAction|93|290-preAction
                // write pre-action user code here
                switchDisplayable(null, getWaitScreen12());//GEN-LINE:|7-commandAction|94|290-postAction
                // write post-action user code here
            }//GEN-BEGIN:|7-commandAction|95|295-preAction
        } else if (displayable == waitScreen15) {
            if (command == WaitScreen.FAILURE_COMMAND) {//GEN-END:|7-commandAction|95|295-preAction
                // write pre-action user code here
                switchDisplayable(null, getList2());//GEN-LINE:|7-commandAction|96|295-postAction
                // write post-action user code here
            } else if (command == WaitScreen.SUCCESS_COMMAND) {//GEN-LINE:|7-commandAction|97|294-preAction
                // write pre-action user code here
                switchDisplayable(null, getList2());//GEN-LINE:|7-commandAction|98|294-postAction
                // write post-action user code here
            }//GEN-BEGIN:|7-commandAction|99|320-preAction
        } else if (displayable == waitScreen16) {
            if (command == WaitScreen.FAILURE_COMMAND) {//GEN-END:|7-commandAction|99|320-preAction
                // write pre-action user code here
                switchDisplayable(null, getList2());//GEN-LINE:|7-commandAction|100|320-postAction
                // write post-action user code here
            } else if (command == WaitScreen.SUCCESS_COMMAND) {//GEN-LINE:|7-commandAction|101|319-preAction
                // write pre-action user code here
                switchDisplayable(null, getList2());//GEN-LINE:|7-commandAction|102|319-postAction
                // write post-action user code here
            }//GEN-BEGIN:|7-commandAction|103|335-preAction
        } else if (displayable == waitScreen17) {
            if (command == WaitScreen.FAILURE_COMMAND) {//GEN-END:|7-commandAction|103|335-preAction
                // write pre-action user code here
                switchDisplayable(null, getWaitScreen19());//GEN-LINE:|7-commandAction|104|335-postAction
                // write post-action user code here
            } else if (command == WaitScreen.SUCCESS_COMMAND) {//GEN-LINE:|7-commandAction|105|334-preAction
                // write pre-action user code here
                switchDisplayable(null, getWaitScreen19());//GEN-LINE:|7-commandAction|106|334-postAction
                // write post-action user code here
            }//GEN-BEGIN:|7-commandAction|107|342-preAction
        } else if (displayable == waitScreen18) {
            if (command == WaitScreen.FAILURE_COMMAND) {//GEN-END:|7-commandAction|107|342-preAction
                // write pre-action user code here
                switchDisplayable(null, getWaitScreen20());//GEN-LINE:|7-commandAction|108|342-postAction
                // write post-action user code here
            } else if (command == WaitScreen.SUCCESS_COMMAND) {//GEN-LINE:|7-commandAction|109|341-preAction
                // write pre-action user code here
                switchDisplayable(null, getWaitScreen20());//GEN-LINE:|7-commandAction|110|341-postAction
                // write post-action user code here
            }//GEN-BEGIN:|7-commandAction|111|349-preAction
        } else if (displayable == waitScreen19) {
            if (command == WaitScreen.FAILURE_COMMAND) {//GEN-END:|7-commandAction|111|349-preAction
                // write pre-action user code here
                switchDisplayable(null, getTownactions());//GEN-LINE:|7-commandAction|112|349-postAction
                // write post-action user code here
            } else if (command == WaitScreen.SUCCESS_COMMAND) {//GEN-LINE:|7-commandAction|113|348-preAction
                // write pre-action user code here
                switchDisplayable(null, getTownactions());//GEN-LINE:|7-commandAction|114|348-postAction
                // write post-action user code here
            }//GEN-BEGIN:|7-commandAction|115|111-preAction
        } else if (displayable == waitScreen2) {
            if (command == WaitScreen.FAILURE_COMMAND) {//GEN-END:|7-commandAction|115|111-preAction
                // write pre-action user code here
                switchDisplayable(null, getForm1());//GEN-LINE:|7-commandAction|116|111-postAction
                // write post-action user code here
            } else if (command == WaitScreen.SUCCESS_COMMAND) {//GEN-LINE:|7-commandAction|117|110-preAction
                // write pre-action user code here
                switchDisplayable(null, getForm1());//GEN-LINE:|7-commandAction|118|110-postAction
                // write post-action user code here
            }//GEN-BEGIN:|7-commandAction|119|357-preAction
        } else if (displayable == waitScreen20) {
            if (command == WaitScreen.FAILURE_COMMAND) {//GEN-END:|7-commandAction|119|357-preAction
                // write pre-action user code here
                switchDisplayable(null, getList3());//GEN-LINE:|7-commandAction|120|357-postAction
                // write post-action user code here
            } else if (command == WaitScreen.SUCCESS_COMMAND) {//GEN-LINE:|7-commandAction|121|356-preAction
                // write pre-action user code here
                switchDisplayable(null, getList3());//GEN-LINE:|7-commandAction|122|356-postAction
                // write post-action user code here
            }//GEN-BEGIN:|7-commandAction|123|412-preAction
        } else if (displayable == waitScreen21) {
            if (command == WaitScreen.FAILURE_COMMAND) {//GEN-END:|7-commandAction|123|412-preAction
                // write pre-action user code here
                switchDisplayable(null, getList7());//GEN-LINE:|7-commandAction|124|412-postAction
                // write post-action user code here
            } else if (command == WaitScreen.SUCCESS_COMMAND) {//GEN-LINE:|7-commandAction|125|411-preAction
                // write pre-action user code here
                switchDisplayable(null, getList7());//GEN-LINE:|7-commandAction|126|411-postAction
                // write post-action user code here
            }//GEN-BEGIN:|7-commandAction|127|421-preAction
        } else if (displayable == waitScreen22) {
            if (command == WaitScreen.FAILURE_COMMAND) {//GEN-END:|7-commandAction|127|421-preAction
                // write pre-action user code here
                switchDisplayable(null, getTownactions());//GEN-LINE:|7-commandAction|128|421-postAction
                // write post-action user code here
            } else if (command == WaitScreen.SUCCESS_COMMAND) {//GEN-LINE:|7-commandAction|129|420-preAction
                // write pre-action user code here
                switchDisplayable(null, getTownactions());//GEN-LINE:|7-commandAction|130|420-postAction
                // write post-action user code here
            }//GEN-BEGIN:|7-commandAction|131|445-preAction
        } else if (displayable == waitScreen23) {
            if (command == WaitScreen.FAILURE_COMMAND) {//GEN-END:|7-commandAction|131|445-preAction
                // write pre-action user code here
                switchDisplayable(null, list1);//GEN-LINE:|7-commandAction|132|445-postAction
                // write post-action user code here
            } else if (command == WaitScreen.SUCCESS_COMMAND) {//GEN-LINE:|7-commandAction|133|444-preAction
                // write pre-action user code here
                switchDisplayable(null, list1);//GEN-LINE:|7-commandAction|134|444-postAction
                // write post-action user code here
            }//GEN-BEGIN:|7-commandAction|135|464-preAction
        } else if (displayable == waitScreen24) {
            if (command == WaitScreen.FAILURE_COMMAND) {//GEN-END:|7-commandAction|135|464-preAction
                // write pre-action user code here
                switchDisplayable(null, list1);//GEN-LINE:|7-commandAction|136|464-postAction
                // write post-action user code here
            } else if (command == WaitScreen.SUCCESS_COMMAND) {//GEN-LINE:|7-commandAction|137|463-preAction
                // write pre-action user code here
                switchDisplayable(null, list1);//GEN-LINE:|7-commandAction|138|463-postAction
                // write post-action user code here
            }//GEN-BEGIN:|7-commandAction|139|484-preAction
        } else if (displayable == waitScreen25) {
            if (command == WaitScreen.FAILURE_COMMAND) {//GEN-END:|7-commandAction|139|484-preAction
                // write pre-action user code here
                switchDisplayable(null, getList9());//GEN-LINE:|7-commandAction|140|484-postAction
                // write post-action user code here
            } else if (command == WaitScreen.SUCCESS_COMMAND) {//GEN-LINE:|7-commandAction|141|483-preAction
                // write pre-action user code here
                switchDisplayable(null, getList9());//GEN-LINE:|7-commandAction|142|483-postAction
                // write post-action user code here
            }//GEN-BEGIN:|7-commandAction|143|502-preAction
        } else if (displayable == waitScreen26) {
            if (command == WaitScreen.FAILURE_COMMAND) {//GEN-END:|7-commandAction|143|502-preAction
                // write pre-action user code here
                switchDisplayable(null, getList());//GEN-LINE:|7-commandAction|144|502-postAction
                // write post-action user code here
            } else if (command == WaitScreen.SUCCESS_COMMAND) {//GEN-LINE:|7-commandAction|145|501-preAction
                // write pre-action user code here
                switchDisplayable(null, getList());//GEN-LINE:|7-commandAction|146|501-postAction
                // write post-action user code here
            }//GEN-BEGIN:|7-commandAction|147|123-preAction
        } else if (displayable == waitScreen3) {
            if (command == WaitScreen.FAILURE_COMMAND) {//GEN-END:|7-commandAction|147|123-preAction
                // write pre-action user code here
                switchDisplayable(null, getWaitScreen12());//GEN-LINE:|7-commandAction|148|123-postAction
                // write post-action user code here
            } else if (command == WaitScreen.SUCCESS_COMMAND) {//GEN-LINE:|7-commandAction|149|122-preAction
                // write pre-action user code here
                switchDisplayable(null, getWaitScreen12());//GEN-LINE:|7-commandAction|150|122-postAction
                // write post-action user code here
            }//GEN-BEGIN:|7-commandAction|151|144-preAction
        } else if (displayable == waitScreen4) {
            if (command == WaitScreen.FAILURE_COMMAND) {//GEN-END:|7-commandAction|151|144-preAction
                // write pre-action user code here
                switchDisplayable(null, getForm3());//GEN-LINE:|7-commandAction|152|144-postAction
                // write post-action user code here
            } else if (command == WaitScreen.SUCCESS_COMMAND) {//GEN-LINE:|7-commandAction|153|143-preAction
                // write pre-action user code here
                switchDisplayable(null, getForm3());//GEN-LINE:|7-commandAction|154|143-postAction
                // write post-action user code here
            }//GEN-BEGIN:|7-commandAction|155|388-preAction
        } else if (displayable == waitScreen5) {
            if (command == WaitScreen.FAILURE_COMMAND) {//GEN-END:|7-commandAction|155|388-preAction
                // write pre-action user code here
                switchDisplayable(null, getList6());//GEN-LINE:|7-commandAction|156|388-postAction
                // write post-action user code here
            } else if (command == WaitScreen.SUCCESS_COMMAND) {//GEN-LINE:|7-commandAction|157|387-preAction
                // write pre-action user code here
                switchDisplayable(null, getList6());//GEN-LINE:|7-commandAction|158|387-postAction
                // write post-action user code here
            }//GEN-BEGIN:|7-commandAction|159|395-preAction
        } else if (displayable == waitScreen6) {
            if (command == WaitScreen.FAILURE_COMMAND) {//GEN-END:|7-commandAction|159|395-preAction
                // write pre-action user code here
                switchDisplayable(null, getTownactions());//GEN-LINE:|7-commandAction|160|395-postAction
                // write post-action user code here
            } else if (command == WaitScreen.SUCCESS_COMMAND) {//GEN-LINE:|7-commandAction|161|394-preAction
                // write pre-action user code here
                switchDisplayable(null, getTownactions());//GEN-LINE:|7-commandAction|162|394-postAction
                // write post-action user code here
            }//GEN-BEGIN:|7-commandAction|163|185-preAction
        } else if (displayable == waitScreen7) {
            if (command == WaitScreen.FAILURE_COMMAND) {//GEN-END:|7-commandAction|163|185-preAction
                // write pre-action user code here
                switchDisplayable(null, getWaitScreen2());//GEN-LINE:|7-commandAction|164|185-postAction
                // write post-action user code here
            } else if (command == WaitScreen.SUCCESS_COMMAND) {//GEN-LINE:|7-commandAction|165|184-preAction
                // write pre-action user code here
                switchDisplayable(null, getWaitScreen2());//GEN-LINE:|7-commandAction|166|184-postAction
                // write post-action user code here
            } else if (command == stopCommand) {//GEN-LINE:|7-commandAction|167|194-preAction
                // write pre-action user code here
                switchDisplayable(null, getForm6());//GEN-LINE:|7-commandAction|168|194-postAction
                // write post-action user code here
            }//GEN-BEGIN:|7-commandAction|169|199-preAction
        } else if (displayable == waitScreen8) {
            if (command == WaitScreen.FAILURE_COMMAND) {//GEN-END:|7-commandAction|169|199-preAction
                // write pre-action user code here
                switchDisplayable(null, form2);//GEN-LINE:|7-commandAction|170|199-postAction
                // write post-action user code here
            } else if (command == WaitScreen.SUCCESS_COMMAND) {//GEN-LINE:|7-commandAction|171|198-preAction
                // write pre-action user code here
                switchDisplayable(null, form2);//GEN-LINE:|7-commandAction|172|198-postAction
                // write post-action user code here
            }//GEN-BEGIN:|7-commandAction|173|224-preAction
        } else if (displayable == waitScreen9) {
            if (command == WaitScreen.FAILURE_COMMAND) {//GEN-END:|7-commandAction|173|224-preAction
                // write pre-action user code here
                switchDisplayable(null, list1);//GEN-LINE:|7-commandAction|174|224-postAction
                // write post-action user code here
            } else if (command == WaitScreen.SUCCESS_COMMAND) {//GEN-LINE:|7-commandAction|175|223-preAction
                // write pre-action user code here
                switchDisplayable(null, list1);//GEN-LINE:|7-commandAction|176|223-postAction
                // write post-action user code here
            }//GEN-BEGIN:|7-commandAction|177|7-postCommandAction
        }//GEN-END:|7-commandAction|177|7-postCommandAction
        // write post-action user code here
    }//GEN-BEGIN:|7-commandAction|178|
    //</editor-fold>//GEN-END:|7-commandAction|178|



    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: townactions ">//GEN-BEGIN:|14-getter|0|14-preInit
    /**
     * Returns an initiliazed instance of townactions component.
     * @return the initialized component instance
     */
    public List getTownactions() {
        if (townactions == null) {//GEN-END:|14-getter|0|14-preInit
            // write pre-init user code here

            townactions = new List("town actions", Choice.IMPLICIT);//GEN-BEGIN:|14-getter|1|14-postInit
            townactions.append("you level is " + Integer.toString(LVL), null);
            townactions.append("you HP is " + Integer.toString(HP), null);
            townactions.append("rest in inn", null);
            townactions.append("travel", null);
            townactions.append("bank", null);
            townactions.append("Battle", null);
            townactions.append("weapon shop", null);
            townactions.append("armour shop", null);
            townactions.append("character info", null);
            townactions.append("rob a bank", null);
            townactions.addCommand(getExitCommand());
            townactions.setCommandListener(this);
            townactions.setSelectedFlags(new boolean[] { false, false, false, false, false, false, false, false, false, false });//GEN-END:|14-getter|1|14-postInit
            // write post-init user code here
        }//GEN-BEGIN:|14-getter|2|
        return townactions;
    }
    //</editor-fold>//GEN-END:|14-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Method: townactionsAction ">//GEN-BEGIN:|14-action|0|14-preAction
    /**
     * Performs an action assigned to the selected list element in the townactions component.
     */
    public void townactionsAction() {//GEN-END:|14-action|0|14-preAction
        // enter pre-action user code here
        String __selectedString = getTownactions().getString(getTownactions().getSelectedIndex());//GEN-BEGIN:|14-action|1|271-preAction
        if (__selectedString != null) {
            if (__selectedString.equals("you level is " + Integer.toString(LVL))) {//GEN-END:|14-action|1|271-preAction
                // write pre-action user code here
//GEN-LINE:|14-action|2|271-postAction
                // write post-action user code here
            } else if (__selectedString.equals("you HP is " + Integer.toString(HP))) {//GEN-LINE:|14-action|3|244-preAction
                // write pre-action user code here
//GEN-LINE:|14-action|4|244-postAction
                // write post-action user code here
            } else if (__selectedString.equals("rest in inn")) {//GEN-LINE:|14-action|5|19-preAction
                // write pre-action user code here
                switchDisplayable(null, getForm());//GEN-LINE:|14-action|6|19-postAction
                // write post-action user code here
            } else if (__selectedString.equals("travel")) {//GEN-LINE:|14-action|7|37-preAction
                // write pre-action user code here
                switchDisplayable(null, getWaitScreen2());//GEN-LINE:|14-action|8|37-postAction
                // write post-action user code here
            } else if (__selectedString.equals("bank")) {//GEN-LINE:|14-action|9|90-preAction
                // write pre-action user code here
                switchDisplayable(null, getWaitScreen8());//GEN-LINE:|14-action|10|90-postAction
                // write post-action user code here
            } else if (__selectedString.equals("Battle")) {//GEN-LINE:|14-action|11|221-preAction
                // write pre-action user code here
                switchDisplayable(null, getWaitScreen9());//GEN-LINE:|14-action|12|221-postAction
                // write post-action user code here
            } else if (__selectedString.equals("weapon shop")) {//GEN-LINE:|14-action|13|325-preAction
                // write pre-action user code here
                switchDisplayable(null, getWaitScreen18());//GEN-LINE:|14-action|14|325-postAction
                // write post-action user code here
            } else if (__selectedString.equals("armour shop")) {//GEN-LINE:|14-action|15|404-preAction
                // write pre-action user code here
                switchDisplayable(null, getWaitScreen5());//GEN-LINE:|14-action|16|404-postAction
                // write post-action user code here
            } else if (__selectedString.equals("character info")) {//GEN-LINE:|14-action|17|406-preAction
                // write pre-action user code here
                switchDisplayable(null, getWaitScreen21());//GEN-LINE:|14-action|18|406-postAction
                // write post-action user code here
            } else if (__selectedString.equals("rob a bank")) {//GEN-LINE:|14-action|19|509-preAction
                // write pre-action user code here
                switchDisplayable(null, getWaitScreen26());//GEN-LINE:|14-action|20|509-postAction
                // write post-action user code here
            }//GEN-BEGIN:|14-action|21|14-postAction
        }//GEN-END:|14-action|21|14-postAction
        // enter post-action user code here
    }//GEN-BEGIN:|14-action|22|
    //</editor-fold>//GEN-END:|14-action|22|


    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: form ">//GEN-BEGIN:|20-getter|0|20-preInit
    /**
     * Returns an initiliazed instance of form component.
     * @return the initialized component instance
     */
    public Form getForm() {
        if (form == null) {//GEN-END:|20-getter|0|20-preInit
            // write pre-init user code here
            form = new Form("form", new Item[] { getStringItem3(), getChoiceGroup() });//GEN-BEGIN:|20-getter|1|20-postInit
            form.addCommand(okCommand);
            form.addCommand(rumors);
            form.addCommand(getExit());
            form.setCommandListener(this);//GEN-END:|20-getter|1|20-postInit
            // write post-init user code here
        }//GEN-BEGIN:|20-getter|2|
        return form;
    }
    //</editor-fold>//GEN-END:|20-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: choiceGroup ">//GEN-BEGIN:|23-getter|0|23-preInit
    /**
     * Returns an initiliazed instance of choiceGroup component.
     * @return the initialized component instance
     */
    public ChoiceGroup getChoiceGroup() {
        if (choiceGroup == null) {//GEN-END:|23-getter|0|23-preInit
            // write pre-init user code here
            choiceGroup = new ChoiceGroup("choose:", Choice.EXCLUSIVE);//GEN-BEGIN:|23-getter|1|23-postInit
            choiceGroup.append("yes", null);
            choiceGroup.append("no", null);
            choiceGroup.setSelectedFlags(new boolean[] { false, false });//GEN-END:|23-getter|1|23-postInit
            // write post-init user code here
        }//GEN-BEGIN:|23-getter|2|
        return choiceGroup;
    }
    //</editor-fold>//GEN-END:|23-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: form1 ">//GEN-BEGIN:|36-getter|0|36-preInit
    /**
     * Returns an initiliazed instance of form1 component.
     * @return the initialized component instance
     */
    public Form getForm1() {
        if (form1 == null) {//GEN-END:|36-getter|0|36-preInit
            // write pre-init user code here

            form1 = new Form("form1", new Item[] { stringItem });//GEN-BEGIN:|36-getter|1|36-postInit
            form1.addCommand(okCommand1);
            form1.addCommand(getStopCommand1());
            form1.addCommand(getBattle());
            form1.setCommandListener(this);//GEN-END:|36-getter|1|36-postInit
            // write post-init user code here
        }//GEN-BEGIN:|36-getter|2|
        return form1;
    }
    //</editor-fold>//GEN-END:|36-getter|2|




        // enter pre-action user code here

        // enter post-action user code here


    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: deposit ">//GEN-BEGIN:|78-getter|0|78-preInit
    /**
     * Returns an initiliazed instance of deposit component.
     * @return the initialized component instance
     */
    public Command getDeposit() {
        if (deposit == null) {//GEN-END:|78-getter|0|78-preInit
            // write pre-init user code here
            deposit = new Command("deposit", "<null>", Command.OK, 0);//GEN-LINE:|78-getter|1|78-postInit
            // write post-init user code here
        }//GEN-BEGIN:|78-getter|2|
        return deposit;
    }
    //</editor-fold>//GEN-END:|78-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: backtocenter ">//GEN-BEGIN:|81-getter|0|81-preInit
    /**
     * Returns an initiliazed instance of backtocenter component.
     * @return the initialized component instance
     */
    public Command getBacktocenter() {
        if (backtocenter == null) {//GEN-END:|81-getter|0|81-preInit
            // write pre-init user code here
            backtocenter = new Command("Back to center", "<null>", Command.BACK, 0);//GEN-LINE:|81-getter|1|81-postInit
            // write post-init user code here
        }//GEN-BEGIN:|81-getter|2|
        return backtocenter;
    }
    //</editor-fold>//GEN-END:|81-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: textField1 ">//GEN-BEGIN:|86-getter|0|86-preInit
    /**
     * Returns an initiliazed instance of textField1 component.
     * @return the initialized component instance
     */
    public TextField getTextField1() {
        if (textField1 == null) {//GEN-END:|86-getter|0|86-preInit
            // write pre-init user code here
            textField1 = new TextField("withdraw / deposit", null, 32, TextField.ANY);//GEN-LINE:|86-getter|1|86-postInit
            // write post-init user code here
        }//GEN-BEGIN:|86-getter|2|
        return textField1;
    }
    //</editor-fold>//GEN-END:|86-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: waitScreen ">//GEN-BEGIN:|92-getter|0|92-preInit
    /**
     * Returns an initiliazed instance of waitScreen component.
     * @return the initialized component instance
     */
    public WaitScreen getWaitScreen() {
        if (waitScreen == null) {//GEN-END:|92-getter|0|92-preInit
            // write pre-init user code here
            waitScreen = new WaitScreen(getDisplay());//GEN-BEGIN:|92-getter|1|92-postInit
            waitScreen.setTitle("waitScreen");
            waitScreen.setCommandListener(this);
            waitScreen.setTask(getTask1());//GEN-END:|92-getter|1|92-postInit
            // write post-init user code here
        }//GEN-BEGIN:|92-getter|2|
        return waitScreen;
    }
    //</editor-fold>//GEN-END:|92-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: task1 ">//GEN-BEGIN:|95-getter|0|95-preInit
    /**
     * Returns an initiliazed instance of task1 component.
     * @return the initialized component instance
     */
    public SimpleCancellableTask getTask1() {
        if (task1 == null) {//GEN-END:|95-getter|0|95-preInit
            // write pre-init user code here
            task1 = new SimpleCancellableTask();//GEN-BEGIN:|95-getter|1|95-execute
            task1.setExecutable(new org.netbeans.microedition.util.Executable() {
                public void execute() throws Exception {//GEN-END:|95-getter|1|95-execute
                    // write task-execution user code here
                    WITHDRAW();
                }//GEN-BEGIN:|95-getter|2|95-postInit
            });//GEN-END:|95-getter|2|95-postInit
            // write post-init user code here
        }//GEN-BEGIN:|95-getter|3|
        return task1;
    }
    //</editor-fold>//GEN-END:|95-getter|3|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: waitScreen1 ">//GEN-BEGIN:|101-getter|0|101-preInit
    /**
     * Returns an initiliazed instance of waitScreen1 component.
     * @return the initialized component instance
     */
    public WaitScreen getWaitScreen1() {
        if (waitScreen1 == null) {//GEN-END:|101-getter|0|101-preInit
            // write pre-init user code here
            waitScreen1 = new WaitScreen(getDisplay());//GEN-BEGIN:|101-getter|1|101-postInit
            waitScreen1.setTitle("waitScreen1");
            waitScreen1.setCommandListener(this);
            waitScreen1.setTask(getTask2());//GEN-END:|101-getter|1|101-postInit
            // write post-init user code here
        }//GEN-BEGIN:|101-getter|2|
        return waitScreen1;
    }
    //</editor-fold>//GEN-END:|101-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: task2 ">//GEN-BEGIN:|104-getter|0|104-preInit
    /**
     * Returns an initiliazed instance of task2 component.
     * @return the initialized component instance
     */
    public SimpleCancellableTask getTask2() {
        if (task2 == null) {//GEN-END:|104-getter|0|104-preInit
            // write pre-init user code here
            task2 = new SimpleCancellableTask();//GEN-BEGIN:|104-getter|1|104-execute
            task2.setExecutable(new org.netbeans.microedition.util.Executable() {
                public void execute() throws Exception {//GEN-END:|104-getter|1|104-execute
                    // write task-execution user code here
 DEPOSIT();
                }//GEN-BEGIN:|104-getter|2|104-postInit
            });//GEN-END:|104-getter|2|104-postInit
            // write post-init user code here
        }//GEN-BEGIN:|104-getter|3|
        return task2;
    }
    //</editor-fold>//GEN-END:|104-getter|3|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: withdraw ">//GEN-BEGIN:|99-getter|0|99-preInit
    /**
     * Returns an initiliazed instance of withdraw component.
     * @return the initialized component instance
     */
    public Command getWithdraw() {
        if (withdraw == null) {//GEN-END:|99-getter|0|99-preInit
            // write pre-init user code here
            withdraw = new Command("withdraw", "", Command.OK, 0);//GEN-LINE:|99-getter|1|99-postInit
            // write post-init user code here
        }//GEN-BEGIN:|99-getter|2|
        return withdraw;
    }
    //</editor-fold>//GEN-END:|99-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: waitScreen2 ">//GEN-BEGIN:|109-getter|0|109-preInit
    /**
     * Returns an initiliazed instance of waitScreen2 component.
     * @return the initialized component instance
     */
    public WaitScreen getWaitScreen2() {
        if (waitScreen2 == null) {//GEN-END:|109-getter|0|109-preInit
            // write pre-init user code here
            waitScreen2 = new WaitScreen(getDisplay());//GEN-BEGIN:|109-getter|1|109-postInit
            waitScreen2.setTitle("waitScreen2");
            waitScreen2.setCommandListener(this);
            waitScreen2.setTask(getTask());//GEN-END:|109-getter|1|109-postInit
            // write post-init user code here
        }//GEN-BEGIN:|109-getter|2|
        return waitScreen2;
    }
    //</editor-fold>//GEN-END:|109-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: task ">//GEN-BEGIN:|112-getter|0|112-preInit
    /**
     * Returns an initiliazed instance of task component.
     * @return the initialized component instance
     */
    public SimpleCancellableTask getTask() {
        if (task == null) {//GEN-END:|112-getter|0|112-preInit
            // write pre-init user code here
            task = new SimpleCancellableTask();//GEN-BEGIN:|112-getter|1|112-execute
            task.setExecutable(new org.netbeans.microedition.util.Executable() {
                public void execute() throws Exception {//GEN-END:|112-getter|1|112-execute
                    // write task-execution user code here
                    travel();

                }//GEN-BEGIN:|112-getter|2|112-postInit
            });//GEN-END:|112-getter|2|112-postInit
            // write post-init user code here
        }//GEN-BEGIN:|112-getter|3|
        return task;
    }
    //</editor-fold>//GEN-END:|112-getter|3|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: exitCommand ">//GEN-BEGIN:|117-getter|0|117-preInit
    /**
     * Returns an initiliazed instance of exitCommand component.
     * @return the initialized component instance
     */
    public Command getExitCommand() {
        if (exitCommand == null) {//GEN-END:|117-getter|0|117-preInit
            // write pre-init user code here
            exitCommand = new Command("Exit", Command.EXIT, 0);//GEN-LINE:|117-getter|1|117-postInit
            // write post-init user code here
        }//GEN-BEGIN:|117-getter|2|
        return exitCommand;
    }
    //</editor-fold>//GEN-END:|117-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: stringItem3 ">//GEN-BEGIN:|120-getter|0|120-preInit
    /**
     * Returns an initiliazed instance of stringItem3 component.
     * @return the initialized component instance
     */
    public StringItem getStringItem3() {
        if (stringItem3 == null) {//GEN-END:|120-getter|0|120-preInit
            // write pre-init user code here
            stringItem3 = new StringItem("do you want to rest in the inn?", "");//GEN-LINE:|120-getter|1|120-postInit
            // write post-init user code here
        }//GEN-BEGIN:|120-getter|2|
        return stringItem3;
    }
    //</editor-fold>//GEN-END:|120-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: waitScreen3 ">//GEN-BEGIN:|121-getter|0|121-preInit
    /**
     * Returns an initiliazed instance of waitScreen3 component.
     * @return the initialized component instance
     */
    public WaitScreen getWaitScreen3() {
        if (waitScreen3 == null) {//GEN-END:|121-getter|0|121-preInit
            // write pre-init user code here
            waitScreen3 = new WaitScreen(getDisplay());//GEN-BEGIN:|121-getter|1|121-postInit
            waitScreen3.setTitle("waitScreen3");
            waitScreen3.setCommandListener(this);
            waitScreen3.setTask(getTask3());//GEN-END:|121-getter|1|121-postInit
            // write post-init user code here
        }//GEN-BEGIN:|121-getter|2|
        return waitScreen3;
    }
    //</editor-fold>//GEN-END:|121-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: task3 ">//GEN-BEGIN:|124-getter|0|124-preInit
    /**
     * Returns an initiliazed instance of task3 component.
     * @return the initialized component instance
     */
    public SimpleCancellableTask getTask3() {
        if (task3 == null) {//GEN-END:|124-getter|0|124-preInit
            // write pre-init user code here
            task3 = new SimpleCancellableTask();//GEN-BEGIN:|124-getter|1|124-execute
            task3.setExecutable(new org.netbeans.microedition.util.Executable() {
                public void execute() throws Exception {//GEN-END:|124-getter|1|124-execute
                    // write task-execution user code here
inn();
                }//GEN-BEGIN:|124-getter|2|124-postInit
            });//GEN-END:|124-getter|2|124-postInit
            // write post-init user code here
        }//GEN-BEGIN:|124-getter|3|
        return task3;
    }
    //</editor-fold>//GEN-END:|124-getter|3|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: form3 ">//GEN-BEGIN:|132-getter|0|132-preInit
    /**
     * Returns an initiliazed instance of form3 component.
     * @return the initialized component instance
     */
    public Form getForm3() {
        if (form3 == null) {//GEN-END:|132-getter|0|132-preInit
            // write pre-init user code here
            form3 = new Form("form3", new Item[] { stringItem4 });//GEN-BEGIN:|132-getter|1|132-postInit
            form3.addCommand(getExit1());
            form3.setCommandListener(this);//GEN-END:|132-getter|1|132-postInit
            // write post-init user code here
        }//GEN-BEGIN:|132-getter|2|
        return form3;
    }
    //</editor-fold>//GEN-END:|132-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: exit1 ">//GEN-BEGIN:|134-getter|0|134-preInit
    /**
     * Returns an initiliazed instance of exit1 component.
     * @return the initialized component instance
     */
    public Command getExit1() {
        if (exit1 == null) {//GEN-END:|134-getter|0|134-preInit
            // write pre-init user code here
            exit1 = new Command("Exit", Command.EXIT, 0);//GEN-LINE:|134-getter|1|134-postInit
            // write post-init user code here
        }//GEN-BEGIN:|134-getter|2|
        return exit1;
    }
    //</editor-fold>//GEN-END:|134-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: exit ">//GEN-BEGIN:|137-getter|0|137-preInit
    /**
     * Returns an initiliazed instance of exit component.
     * @return the initialized component instance
     */
    public Command getExit() {
        if (exit == null) {//GEN-END:|137-getter|0|137-preInit
            // write pre-init user code here
            exit = new Command("Exit", Command.EXIT, 0);//GEN-LINE:|137-getter|1|137-postInit
            // write post-init user code here
        }//GEN-BEGIN:|137-getter|2|
        return exit;
    }
    //</editor-fold>//GEN-END:|137-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: waitScreen4 ">//GEN-BEGIN:|142-getter|0|142-preInit
    /**
     * Returns an initiliazed instance of waitScreen4 component.
     * @return the initialized component instance
     */
    public WaitScreen getWaitScreen4() {
        if (waitScreen4 == null) {//GEN-END:|142-getter|0|142-preInit
            // write pre-init user code here
            waitScreen4 = new WaitScreen(getDisplay());//GEN-BEGIN:|142-getter|1|142-postInit
            waitScreen4.setTitle("waitScreen4");
            waitScreen4.setCommandListener(this);
            waitScreen4.setTask(getTask4());//GEN-END:|142-getter|1|142-postInit
            // write post-init user code here
        }//GEN-BEGIN:|142-getter|2|
        return waitScreen4;
    }
    //</editor-fold>//GEN-END:|142-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: task4 ">//GEN-BEGIN:|145-getter|0|145-preInit
    /**
     * Returns an initiliazed instance of task4 component.
     * @return the initialized component instance
     */
    public SimpleCancellableTask getTask4() {
        if (task4 == null) {//GEN-END:|145-getter|0|145-preInit
            // write pre-init user code here
            task4 = new SimpleCancellableTask();//GEN-BEGIN:|145-getter|1|145-execute
            task4.setExecutable(new org.netbeans.microedition.util.Executable() {
                public void execute() throws Exception {//GEN-END:|145-getter|1|145-execute
                    // write task-execution user code here
                    rumors();
                }//GEN-BEGIN:|145-getter|2|145-postInit
            });//GEN-END:|145-getter|2|145-postInit
            // write post-init user code here
        }//GEN-BEGIN:|145-getter|3|
        return task4;
    }
    //</editor-fold>//GEN-END:|145-getter|3|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: waitScreen7 ">//GEN-BEGIN:|183-getter|0|183-preInit
    /**
     * Returns an initiliazed instance of waitScreen7 component.
     * @return the initialized component instance
     */
    public WaitScreen getWaitScreen7() {
        if (waitScreen7 == null) {//GEN-END:|183-getter|0|183-preInit
            // write pre-init user code here
            waitScreen7 = new WaitScreen(getDisplay());//GEN-BEGIN:|183-getter|1|183-postInit
            waitScreen7.setTitle("waitScreen7");
            waitScreen7.addCommand(stopCommand);
            waitScreen7.setCommandListener(this);
            waitScreen7.setTask(getTask7());//GEN-END:|183-getter|1|183-postInit
            // write post-init user code here
        }//GEN-BEGIN:|183-getter|2|
        return waitScreen7;
    }
    //</editor-fold>//GEN-END:|183-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: task7 ">//GEN-BEGIN:|186-getter|0|186-preInit
    /**
     * Returns an initiliazed instance of task7 component.
     * @return the initialized component instance
     */
    public SimpleCancellableTask getTask7() {
        if (task7 == null) {//GEN-END:|186-getter|0|186-preInit
            // write pre-init user code here
            task7 = new SimpleCancellableTask();//GEN-BEGIN:|186-getter|1|186-execute
            task7.setExecutable(new org.netbeans.microedition.util.Executable() {
                public void execute() throws Exception {//GEN-END:|186-getter|1|186-execute
                    // write task-execution user code here

                }//GEN-BEGIN:|186-getter|2|186-postInit
            });//GEN-END:|186-getter|2|186-postInit
            // write post-init user code here
        }//GEN-BEGIN:|186-getter|3|
        return task7;
    }
    //</editor-fold>//GEN-END:|186-getter|3|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: form6 ">//GEN-BEGIN:|189-getter|0|189-preInit
    /**
     * Returns an initiliazed instance of form6 component.
     * @return the initialized component instance
     */
    public Form getForm6() {
        if (form6 == null) {//GEN-END:|189-getter|0|189-preInit
            // write pre-init user code here
            form6 = new Form("form6");//GEN-BEGIN:|189-getter|1|189-postInit
            form6.addCommand(town);
            form6.setCommandListener(this);//GEN-END:|189-getter|1|189-postInit
            // write post-init user code here
        }//GEN-BEGIN:|189-getter|2|
        return form6;
    }
    //</editor-fold>//GEN-END:|189-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: waitScreen8 ">//GEN-BEGIN:|197-getter|0|197-preInit
    /**
     * Returns an initiliazed instance of waitScreen8 component.
     * @return the initialized component instance
     */
    public WaitScreen getWaitScreen8() {
        if (waitScreen8 == null) {//GEN-END:|197-getter|0|197-preInit
            // write pre-init user code here
            waitScreen8 = new WaitScreen(getDisplay());//GEN-BEGIN:|197-getter|1|197-postInit
            waitScreen8.setTitle("waitScreen8");
            waitScreen8.setCommandListener(this);
            waitScreen8.setTask(getTask8());//GEN-END:|197-getter|1|197-postInit
            // write post-init user code here
        }//GEN-BEGIN:|197-getter|2|
        return waitScreen8;
    }
    //</editor-fold>//GEN-END:|197-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: task8 ">//GEN-BEGIN:|200-getter|0|200-preInit
    /**
     * Returns an initiliazed instance of task8 component.
     * @return the initialized component instance
     */
    public SimpleCancellableTask getTask8() {
        if (task8 == null) {//GEN-END:|200-getter|0|200-preInit
            // write pre-init user code here
            task8 = new SimpleCancellableTask();//GEN-BEGIN:|200-getter|1|200-execute
            task8.setExecutable(new org.netbeans.microedition.util.Executable() {
                public void execute() throws Exception {//GEN-END:|200-getter|1|200-execute
                    // write task-execution user code here
                    stringItem1.setText(Integer.toString(BANK));
                    stringItem2.setText(Integer.toString(GOLD));
                }//GEN-BEGIN:|200-getter|2|200-postInit
            });//GEN-END:|200-getter|2|200-postInit
            // write post-init user code here
        }//GEN-BEGIN:|200-getter|3|
        return task8;
    }
    //</editor-fold>//GEN-END:|200-getter|3|





    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: waitScreen9 ">//GEN-BEGIN:|222-getter|0|222-preInit
    /**
     * Returns an initiliazed instance of waitScreen9 component.
     * @return the initialized component instance
     */
    public WaitScreen getWaitScreen9() {
        if (waitScreen9 == null) {//GEN-END:|222-getter|0|222-preInit
            // write pre-init user code here
            waitScreen9 = new WaitScreen(getDisplay());//GEN-BEGIN:|222-getter|1|222-postInit
            waitScreen9.setTitle("waitScreen9");
            waitScreen9.setCommandListener(this);
            waitScreen9.setTask(getTask10());//GEN-END:|222-getter|1|222-postInit
            // write post-init user code here
        }//GEN-BEGIN:|222-getter|2|
        return waitScreen9;
    }
    //</editor-fold>//GEN-END:|222-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Method: list1Action ">//GEN-BEGIN:|226-action|0|226-preAction
    /**
     * Performs an action assigned to the selected list element in the list1 component.
     */
    public void list1Action() {//GEN-END:|226-action|0|226-preAction
        // enter pre-action user code here
        String __selectedString = list1.getString(list1.getSelectedIndex());//GEN-LINE:|226-action|1|226-postAction
        // enter post-action user code here
    }//GEN-BEGIN:|226-action|2|
    //</editor-fold>//GEN-END:|226-action|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: task10 ">//GEN-BEGIN:|225-getter|0|225-preInit
    /**
     * Returns an initiliazed instance of task10 component.
     * @return the initialized component instance
     */
    public SimpleCancellableTask getTask10() {
        if (task10 == null) {//GEN-END:|225-getter|0|225-preInit
            // write pre-init user code here
            task10 = new SimpleCancellableTask();//GEN-BEGIN:|225-getter|1|225-execute
            task10.setExecutable(new org.netbeans.microedition.util.Executable() {
                public void execute() throws Exception {//GEN-END:|225-getter|1|225-execute
                    // write task-execution user code here
                    arena();
                }//GEN-BEGIN:|225-getter|2|225-postInit
            });//GEN-END:|225-getter|2|225-postInit
            // write post-init user code here
        }//GEN-BEGIN:|225-getter|3|
        return task10;
    }
    //</editor-fold>//GEN-END:|225-getter|3|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: waitScreen10 ">//GEN-BEGIN:|234-getter|0|234-preInit
    /**
     * Returns an initiliazed instance of waitScreen10 component.
     * @return the initialized component instance
     */
    public WaitScreen getWaitScreen10() {
        if (waitScreen10 == null) {//GEN-END:|234-getter|0|234-preInit
            // write pre-init user code here
            waitScreen10 = new WaitScreen(getDisplay());//GEN-BEGIN:|234-getter|1|234-postInit
            waitScreen10.setTitle("waitScreen10");
            waitScreen10.setCommandListener(this);
            waitScreen10.setTask(getTask11());//GEN-END:|234-getter|1|234-postInit
            // write post-init user code here
        }//GEN-BEGIN:|234-getter|2|
        return waitScreen10;
    }
    //</editor-fold>//GEN-END:|234-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: task11 ">//GEN-BEGIN:|237-getter|0|237-preInit
    /**
     * Returns an initiliazed instance of task11 component.
     * @return the initialized component instance
     */
    public SimpleCancellableTask getTask11() {
        if (task11 == null) {//GEN-END:|237-getter|0|237-preInit
            // write pre-init user code here
            task11 = new SimpleCancellableTask();//GEN-BEGIN:|237-getter|1|237-execute
            task11.setExecutable(new org.netbeans.microedition.util.Executable() {
                public void execute() throws Exception {//GEN-END:|237-getter|1|237-execute
                    // write task-execution user code here
                    attack();
                }//GEN-BEGIN:|237-getter|2|237-postInit
            });//GEN-END:|237-getter|2|237-postInit
            // write post-init user code here
        }//GEN-BEGIN:|237-getter|3|
        return task11;
    }
    //</editor-fold>//GEN-END:|237-getter|3|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: exitCommand1 ">//GEN-BEGIN:|241-getter|0|241-preInit
    /**
     * Returns an initiliazed instance of exitCommand1 component.
     * @return the initialized component instance
     */
    public Command getExitCommand1() {
        if (exitCommand1 == null) {//GEN-END:|241-getter|0|241-preInit
            // write pre-init user code here
            exitCommand1 = new Command("Exit", Command.EXIT, 0);//GEN-LINE:|241-getter|1|241-postInit
            // write post-init user code here
        }//GEN-BEGIN:|241-getter|2|
        return exitCommand1;
    }
    //</editor-fold>//GEN-END:|241-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: waitScreen11 ">//GEN-BEGIN:|246-getter|0|246-preInit
    /**
     * Returns an initiliazed instance of waitScreen11 component.
     * @return the initialized component instance
     */
    public WaitScreen getWaitScreen11() {
        if (waitScreen11 == null) {//GEN-END:|246-getter|0|246-preInit
            // write pre-init user code here
            waitScreen11 = new WaitScreen(getDisplay());//GEN-BEGIN:|246-getter|1|246-postInit
            waitScreen11.setTitle("waitScreen11");
            waitScreen11.setCommandListener(this);
            waitScreen11.setTask(getTask12());//GEN-END:|246-getter|1|246-postInit
            // write post-init user code here
        }//GEN-BEGIN:|246-getter|2|
        return waitScreen11;
    }
    //</editor-fold>//GEN-END:|246-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: task12 ">//GEN-BEGIN:|249-getter|0|249-preInit
    /**
     * Returns an initiliazed instance of task12 component.
     * @return the initialized component instance
     */
    public SimpleCancellableTask getTask12() {
        if (task12 == null) {//GEN-END:|249-getter|0|249-preInit
            // write pre-init user code here
            task12 = new SimpleCancellableTask();//GEN-BEGIN:|249-getter|1|249-execute
            task12.setExecutable(new org.netbeans.microedition.util.Executable() {
                public void execute() throws Exception {//GEN-END:|249-getter|1|249-execute
                    // write task-execution user code here

                 list1.deleteAll();
                 SLIMEHP = MAXSLIMEHP;
                 list1num = 0;

                 return;
                }//GEN-BEGIN:|249-getter|2|249-postInit
            });//GEN-END:|249-getter|2|249-postInit
            // write post-init user code here
        }//GEN-BEGIN:|249-getter|3|
        return task12;
    }
    //</editor-fold>//GEN-END:|249-getter|3|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: waitScreen12 ">//GEN-BEGIN:|253-getter|0|253-preInit
    /**
     * Returns an initiliazed instance of waitScreen12 component.
     * @return the initialized component instance
     */
    public WaitScreen getWaitScreen12() {
        if (waitScreen12 == null) {//GEN-END:|253-getter|0|253-preInit
            // write pre-init user code here
            waitScreen12 = new WaitScreen(getDisplay());//GEN-BEGIN:|253-getter|1|253-postInit
            waitScreen12.setTitle("waitScreen12");
            waitScreen12.setCommandListener(this);
            waitScreen12.setTask(getTask13());//GEN-END:|253-getter|1|253-postInit
            // write post-init user code here
        }//GEN-BEGIN:|253-getter|2|
        return waitScreen12;
    }
    //</editor-fold>//GEN-END:|253-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: task13 ">//GEN-BEGIN:|256-getter|0|256-preInit
    /**
     * Returns an initiliazed instance of task13 component.
     * @return the initialized component instance
     */
    public SimpleCancellableTask getTask13() {
        if (task13 == null) {//GEN-END:|256-getter|0|256-preInit
            // write pre-init user code here
            task13 = new SimpleCancellableTask();//GEN-BEGIN:|256-getter|1|256-execute
            task13.setExecutable(new org.netbeans.microedition.util.Executable() {
                public void execute() throws Exception {//GEN-END:|256-getter|1|256-execute
                    // write task-execution user code here
                     refresHP();
                }//GEN-BEGIN:|256-getter|2|256-postInit
            });//GEN-END:|256-getter|2|256-postInit
            // write post-init user code here
        }//GEN-BEGIN:|256-getter|3|
        return task13;
    }
    //</editor-fold>//GEN-END:|256-getter|3|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: stopCommand1 ">//GEN-BEGIN:|264-getter|0|264-preInit
    /**
     * Returns an initiliazed instance of stopCommand1 component.
     * @return the initialized component instance
     */
    public Command getStopCommand1() {
        if (stopCommand1 == null) {//GEN-END:|264-getter|0|264-preInit
            // write pre-init user code here
            stopCommand1 = new Command("Stop", Command.STOP, 0);//GEN-LINE:|264-getter|1|264-postInit
            // write post-init user code here
        }//GEN-BEGIN:|264-getter|2|
        return stopCommand1;
    }
    //</editor-fold>//GEN-END:|264-getter|2|



    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: waitScreen13 ">//GEN-BEGIN:|277-getter|0|277-preInit
    /**
     * Returns an initiliazed instance of waitScreen13 component.
     * @return the initialized component instance
     */
    public WaitScreen getWaitScreen13() {
        if (waitScreen13 == null) {//GEN-END:|277-getter|0|277-preInit
            // write pre-init user code here
            waitScreen13 = new WaitScreen(getDisplay());//GEN-BEGIN:|277-getter|1|277-postInit
            waitScreen13.setTitle("waitScreen13");
            waitScreen13.setCommandListener(this);
            waitScreen13.setTask(getTask14());//GEN-END:|277-getter|1|277-postInit
            // write post-init user code here
        }//GEN-BEGIN:|277-getter|2|
        return waitScreen13;
    }
    //</editor-fold>//GEN-END:|277-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: task14 ">//GEN-BEGIN:|280-getter|0|280-preInit
    /**
     * Returns an initiliazed instance of task14 component.
     * @return the initialized component instance
     */
    public SimpleCancellableTask getTask14() {
        if (task14 == null) {//GEN-END:|280-getter|0|280-preInit
            // write pre-init user code here
            task14 = new SimpleCancellableTask();//GEN-BEGIN:|280-getter|1|280-execute
            task14.setExecutable(new org.netbeans.microedition.util.Executable() {
                public void execute() throws Exception {//GEN-END:|280-getter|1|280-execute
                    // write task-execution user code here
                    if (list2.isSelected(1)) {

                    } else if (list2.isSelected(0)) {

                    }
                }//GEN-BEGIN:|280-getter|2|280-postInit
            });//GEN-END:|280-getter|2|280-postInit
            // write post-init user code here
        }//GEN-BEGIN:|280-getter|3|
        return task14;
    }
    //</editor-fold>//GEN-END:|280-getter|3|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: list2 ">//GEN-BEGIN:|284-getter|0|284-preInit
    /**
     * Returns an initiliazed instance of list2 component.
     * @return the initialized component instance
     */
    public List getList2() {
        if (list2 == null) {//GEN-END:|284-getter|0|284-preInit
            // write pre-init user code here
            list2 = new List("list2", Choice.IMPLICIT);//GEN-BEGIN:|284-getter|1|284-postInit
            list2.append("new game", null);
            list2.append("read", null);
            list2.append("save", null);
            list2.append("delete save", null);
            list2.addCommand(getExitCommand3());
            list2.setCommandListener(this);
            list2.setSelectedFlags(new boolean[] { false, false, false, false });//GEN-END:|284-getter|1|284-postInit
            // write post-init user code here
        }//GEN-BEGIN:|284-getter|2|
        return list2;
    }
    //</editor-fold>//GEN-END:|284-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Method: list2Action ">//GEN-BEGIN:|284-action|0|284-preAction
    /**
     * Performs an action assigned to the selected list element in the list2 component.
     */
    public void list2Action() {//GEN-END:|284-action|0|284-preAction
        // enter pre-action user code here
        String __selectedString = getList2().getString(getList2().getSelectedIndex());//GEN-BEGIN:|284-action|1|434-preAction
        if (__selectedString != null) {
            if (__selectedString.equals("new game")) {//GEN-END:|284-action|1|434-preAction
                // write pre-action user code here
                switchDisplayable(null, getWaitScreen12());//GEN-LINE:|284-action|2|434-postAction
                // write post-action user code here
            } else if (__selectedString.equals("read")) {//GEN-LINE:|284-action|3|287-preAction
                // write pre-action user code here
                switchDisplayable(null, getList4());//GEN-LINE:|284-action|4|287-postAction
                // write post-action user code here
            } else if (__selectedString.equals("save")) {//GEN-LINE:|284-action|5|288-preAction
                // write pre-action user code here
                switchDisplayable(null, getList5());//GEN-LINE:|284-action|6|288-postAction
                // write post-action user code here
            } else if (__selectedString.equals("delete save")) {//GEN-LINE:|284-action|7|317-preAction
                // write pre-action user code here
                switchDisplayable(null, getWaitScreen16());//GEN-LINE:|284-action|8|317-postAction
                // write post-action user code here
            }//GEN-BEGIN:|284-action|9|284-postAction
        }//GEN-END:|284-action|9|284-postAction
        // enter post-action user code here
    }//GEN-BEGIN:|284-action|10|
    //</editor-fold>//GEN-END:|284-action|10|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: waitScreen14 ">//GEN-BEGIN:|289-getter|0|289-preInit
    /**
     * Returns an initiliazed instance of waitScreen14 component.
     * @return the initialized component instance
     */
    public WaitScreen getWaitScreen14() {
        if (waitScreen14 == null) {//GEN-END:|289-getter|0|289-preInit
            // write pre-init user code here
            waitScreen14 = new WaitScreen(getDisplay());//GEN-BEGIN:|289-getter|1|289-postInit
            waitScreen14.setTitle("waitScreen14");
            waitScreen14.setCommandListener(this);
            waitScreen14.setTask(getTask15());//GEN-END:|289-getter|1|289-postInit
            // write post-init user code here
        }//GEN-BEGIN:|289-getter|2|
        return waitScreen14;
    }
    //</editor-fold>//GEN-END:|289-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: waitScreen15 ">//GEN-BEGIN:|293-getter|0|293-preInit
    /**
     * Returns an initiliazed instance of waitScreen15 component.
     * @return the initialized component instance
     */
    public WaitScreen getWaitScreen15() {
        if (waitScreen15 == null) {//GEN-END:|293-getter|0|293-preInit
            // write pre-init user code here
            waitScreen15 = new WaitScreen(getDisplay());//GEN-BEGIN:|293-getter|1|293-postInit
            waitScreen15.setTitle("waitScreen15");
            waitScreen15.setCommandListener(this);
            waitScreen15.setTask(getTask16());//GEN-END:|293-getter|1|293-postInit
            // write post-init user code here
        }//GEN-BEGIN:|293-getter|2|
        return waitScreen15;
    }
    //</editor-fold>//GEN-END:|293-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: task15 ">//GEN-BEGIN:|292-getter|0|292-preInit
    /**
     * Returns an initiliazed instance of task15 component.
     * @return the initialized component instance
     */
    public SimpleCancellableTask getTask15() {
        if (task15 == null) {//GEN-END:|292-getter|0|292-preInit
            // write pre-init user code here
            task15 = new SimpleCancellableTask();//GEN-BEGIN:|292-getter|1|292-execute
            task15.setExecutable(new org.netbeans.microedition.util.Executable() {
                public void execute() throws Exception {//GEN-END:|292-getter|1|292-execute
                    // write task-execution user code here
                   readFromDisk(1, list4.getString(list4.getSelectedIndex()));
                }//GEN-BEGIN:|292-getter|2|292-postInit
            });//GEN-END:|292-getter|2|292-postInit
            // write post-init user code here
        }//GEN-BEGIN:|292-getter|3|
        return task15;
    }
    //</editor-fold>//GEN-END:|292-getter|3|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: task16 ">//GEN-BEGIN:|296-getter|0|296-preInit
    /**
     * Returns an initiliazed instance of task16 component.
     * @return the initialized component instance
     */
    public SimpleCancellableTask getTask16() {
        if (task16 == null) {//GEN-END:|296-getter|0|296-preInit
            // write pre-init user code here
            task16 = new SimpleCancellableTask();//GEN-BEGIN:|296-getter|1|296-execute
            task16.setExecutable(new org.netbeans.microedition.util.Executable() {
                public void execute() throws Exception {//GEN-END:|296-getter|1|296-execute
                    // write task-execution user code here
                   DELSAVEDATA(list5.getString(list5.getSelectedIndex()));
                }//GEN-BEGIN:|296-getter|2|296-postInit
            });//GEN-END:|296-getter|2|296-postInit
            // write post-init user code here
        }//GEN-BEGIN:|296-getter|3|
        return task16;
    }
    //</editor-fold>//GEN-END:|296-getter|3|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: saveload ">//GEN-BEGIN:|303-getter|0|303-preInit
    /**
     * Returns an initiliazed instance of saveload component.
     * @return the initialized component instance
     */
    public Command getSaveload() {
        if (saveload == null) {//GEN-END:|303-getter|0|303-preInit
            // write pre-init user code here
            saveload = new Command("Ok", Command.OK, 0);//GEN-LINE:|303-getter|1|303-postInit
            // write post-init user code here
        }//GEN-BEGIN:|303-getter|2|
        return saveload;
    }
    //</editor-fold>//GEN-END:|303-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: backCommand ">//GEN-BEGIN:|306-getter|0|306-preInit
    /**
     * Returns an initiliazed instance of backCommand component.
     * @return the initialized component instance
     */
    public Command getBackCommand() {
        if (backCommand == null) {//GEN-END:|306-getter|0|306-preInit
            // write pre-init user code here
            backCommand = new Command("Back", Command.BACK, 0);//GEN-LINE:|306-getter|1|306-postInit
            // write post-init user code here
        }//GEN-BEGIN:|306-getter|2|
        return backCommand;
    }
    //</editor-fold>//GEN-END:|306-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: select ">//GEN-BEGIN:|312-getter|0|312-preInit
    /**
     * Returns an initiliazed instance of select component.
     * @return the initialized component instance
     */
    public Command getSelect() {
        if (select == null) {//GEN-END:|312-getter|0|312-preInit
            // write pre-init user code here
            select = new Command("Ok", Command.OK, 0);//GEN-LINE:|312-getter|1|312-postInit
            // write post-init user code here
        }//GEN-BEGIN:|312-getter|2|
        return select;
    }
    //</editor-fold>//GEN-END:|312-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: waitScreen16 ">//GEN-BEGIN:|318-getter|0|318-preInit
    /**
     * Returns an initiliazed instance of waitScreen16 component.
     * @return the initialized component instance
     */
    public WaitScreen getWaitScreen16() {
        if (waitScreen16 == null) {//GEN-END:|318-getter|0|318-preInit
            // write pre-init user code here
            waitScreen16 = new WaitScreen(getDisplay());//GEN-BEGIN:|318-getter|1|318-postInit
            waitScreen16.setTitle("waitScreen16");
            waitScreen16.setCommandListener(this);
            waitScreen16.setTask(getTask17());//GEN-END:|318-getter|1|318-postInit
            // write post-init user code here
        }//GEN-BEGIN:|318-getter|2|
        return waitScreen16;
    }
    //</editor-fold>//GEN-END:|318-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: task17 ">//GEN-BEGIN:|321-getter|0|321-preInit
    /**
     * Returns an initiliazed instance of task17 component.
     * @return the initialized component instance
     */
    public SimpleCancellableTask getTask17() {
        if (task17 == null) {//GEN-END:|321-getter|0|321-preInit
            // write pre-init user code here
            task17 = new SimpleCancellableTask();//GEN-BEGIN:|321-getter|1|321-execute
            task17.setExecutable(new org.netbeans.microedition.util.Executable() {
                public void execute() throws Exception {//GEN-END:|321-getter|1|321-execute
                    // write task-execution user code here
                    deleteDATA();
                }//GEN-BEGIN:|321-getter|2|321-postInit
            });//GEN-END:|321-getter|2|321-postInit
            // write post-init user code here
        }//GEN-BEGIN:|321-getter|3|
        return task17;
    }
    //</editor-fold>//GEN-END:|321-getter|3|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: attack ">//GEN-BEGIN:|232-getter|0|232-preInit
    /**
     * Returns an initiliazed instance of attack component.
     * @return the initialized component instance
     */
    public Command getAttack() {
        if (attack == null) {//GEN-END:|232-getter|0|232-preInit
            // write pre-init user code here
            attack = new Command("attack", Command.OK, -1);//GEN-LINE:|232-getter|1|232-postInit
            // write post-init user code here
        }//GEN-BEGIN:|232-getter|2|
        return attack;
    }
    //</editor-fold>//GEN-END:|232-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: list3 ">//GEN-BEGIN:|326-getter|0|326-preInit
    /**
     * Returns an initiliazed instance of list3 component.
     * @return the initialized component instance
     */
    public List getList3() {
        if (list3 == null) {//GEN-END:|326-getter|0|326-preInit
            // write pre-init user code here
            list3 = new List("list3", Choice.IMPLICIT);//GEN-BEGIN:|326-getter|1|326-postInit
            list3.append("weapons:", null);
            list3.addCommand(getOkCommand2());
            list3.setCommandListener(this);
            list3.setSelectedFlags(new boolean[] { false });//GEN-END:|326-getter|1|326-postInit
            // write post-init user code here
        }//GEN-BEGIN:|326-getter|2|
        return list3;
    }
    //</editor-fold>//GEN-END:|326-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Method: list3Action ">//GEN-BEGIN:|326-action|0|326-preAction
    /**
     * Performs an action assigned to the selected list element in the list3 component.
     */
    public void list3Action() {//GEN-END:|326-action|0|326-preAction
        // enter pre-action user code here
        String __selectedString = getList3().getString(getList3().getSelectedIndex());//GEN-BEGIN:|326-action|1|329-preAction
        if (__selectedString != null) {
            if (__selectedString.equals("weapons:")) {//GEN-END:|326-action|1|329-preAction
                // write pre-action user code here
//GEN-LINE:|326-action|2|329-postAction
                // write post-action user code here
            }//GEN-BEGIN:|326-action|3|326-postAction
        }//GEN-END:|326-action|3|326-postAction
        // enter post-action user code here
    }//GEN-BEGIN:|326-action|4|
    //</editor-fold>//GEN-END:|326-action|4|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: waitScreen17 ">//GEN-BEGIN:|333-getter|0|333-preInit
    /**
     * Returns an initiliazed instance of waitScreen17 component.
     * @return the initialized component instance
     */
    public WaitScreen getWaitScreen17() {
        if (waitScreen17 == null) {//GEN-END:|333-getter|0|333-preInit
            // write pre-init user code here
            waitScreen17 = new WaitScreen(getDisplay());//GEN-BEGIN:|333-getter|1|333-postInit
            waitScreen17.setTitle("waitScreen17");
            waitScreen17.setCommandListener(this);
            waitScreen17.setTask(getTask18());//GEN-END:|333-getter|1|333-postInit
            // write post-init user code here
        }//GEN-BEGIN:|333-getter|2|
        return waitScreen17;
    }
    //</editor-fold>//GEN-END:|333-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: waitScreen18 ">//GEN-BEGIN:|340-getter|0|340-preInit
    /**
     * Returns an initiliazed instance of waitScreen18 component.
     * @return the initialized component instance
     */
    public WaitScreen getWaitScreen18() {
        if (waitScreen18 == null) {//GEN-END:|340-getter|0|340-preInit
            // write pre-init user code here
            waitScreen18 = new WaitScreen(getDisplay());//GEN-BEGIN:|340-getter|1|340-postInit
            waitScreen18.setTitle("waitScreen18");
            waitScreen18.setCommandListener(this);
            waitScreen18.setTask(getTask19());//GEN-END:|340-getter|1|340-postInit
            // write post-init user code here
        }//GEN-BEGIN:|340-getter|2|
        return waitScreen18;
    }
    //</editor-fold>//GEN-END:|340-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: okCommand2 ">//GEN-BEGIN:|331-getter|0|331-preInit
    /**
     * Returns an initiliazed instance of okCommand2 component.
     * @return the initialized component instance
     */
    public Command getOkCommand2() {
        if (okCommand2 == null) {//GEN-END:|331-getter|0|331-preInit
            // write pre-init user code here
            okCommand2 = new Command("Ok", Command.OK, 0);//GEN-LINE:|331-getter|1|331-postInit
            // write post-init user code here
        }//GEN-BEGIN:|331-getter|2|
        return okCommand2;
    }
    //</editor-fold>//GEN-END:|331-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: task18 ">//GEN-BEGIN:|336-getter|0|336-preInit
    /**
     * Returns an initiliazed instance of task18 component.
     * @return the initialized component instance
     */
    public SimpleCancellableTask getTask18() {
        if (task18 == null) {//GEN-END:|336-getter|0|336-preInit
            // write pre-init user code here
            task18 = new SimpleCancellableTask();//GEN-BEGIN:|336-getter|1|336-execute
            task18.setExecutable(new org.netbeans.microedition.util.Executable() {
                public void execute() throws Exception {//GEN-END:|336-getter|1|336-execute
                    // write task-execution user code here
                    BUYEDWEAPON();
                }//GEN-BEGIN:|336-getter|2|336-postInit
            });//GEN-END:|336-getter|2|336-postInit
            // write post-init user code here
        }//GEN-BEGIN:|336-getter|3|
        return task18;
    }
    //</editor-fold>//GEN-END:|336-getter|3|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: task19 ">//GEN-BEGIN:|343-getter|0|343-preInit
    /**
     * Returns an initiliazed instance of task19 component.
     * @return the initialized component instance
     */
    public SimpleCancellableTask getTask19() {
        if (task19 == null) {//GEN-END:|343-getter|0|343-preInit
            // write pre-init user code here
            task19 = new SimpleCancellableTask();//GEN-BEGIN:|343-getter|1|343-execute
            task19.setExecutable(new org.netbeans.microedition.util.Executable() {
                public void execute() throws Exception {//GEN-END:|343-getter|1|343-execute
                    // write task-execution user code here
                    WEAPONSHOP();
                }//GEN-BEGIN:|343-getter|2|343-postInit
            });//GEN-END:|343-getter|2|343-postInit
            // write post-init user code here
        }//GEN-BEGIN:|343-getter|3|
        return task19;
    }
    //</editor-fold>//GEN-END:|343-getter|3|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: waitScreen19 ">//GEN-BEGIN:|347-getter|0|347-preInit
    /**
     * Returns an initiliazed instance of waitScreen19 component.
     * @return the initialized component instance
     */
    public WaitScreen getWaitScreen19() {
        if (waitScreen19 == null) {//GEN-END:|347-getter|0|347-preInit
            // write pre-init user code here
            waitScreen19 = new WaitScreen(getDisplay());//GEN-BEGIN:|347-getter|1|347-postInit
            waitScreen19.setTitle("waitScreen19");
            waitScreen19.setCommandListener(this);
            waitScreen19.setTask(getTask20());//GEN-END:|347-getter|1|347-postInit
            // write post-init user code here
        }//GEN-BEGIN:|347-getter|2|
        return waitScreen19;
    }
    //</editor-fold>//GEN-END:|347-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: task20 ">//GEN-BEGIN:|350-getter|0|350-preInit
    /**
     * Returns an initiliazed instance of task20 component.
     * @return the initialized component instance
     */
    public SimpleCancellableTask getTask20() {
        if (task20 == null) {//GEN-END:|350-getter|0|350-preInit
            // write pre-init user code here
            task20 = new SimpleCancellableTask();//GEN-BEGIN:|350-getter|1|350-execute
            task20.setExecutable(new org.netbeans.microedition.util.Executable() {
                public void execute() throws Exception {//GEN-END:|350-getter|1|350-execute
                    // write task-execution user code here
                    list3.deleteAll();
                }//GEN-BEGIN:|350-getter|2|350-postInit
            });//GEN-END:|350-getter|2|350-postInit
            // write post-init user code here
        }//GEN-BEGIN:|350-getter|3|
        return task20;
    }
    //</editor-fold>//GEN-END:|350-getter|3|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: waitScreen20 ">//GEN-BEGIN:|355-getter|0|355-preInit
    /**
     * Returns an initiliazed instance of waitScreen20 component.
     * @return the initialized component instance
     */
    public WaitScreen getWaitScreen20() {
        if (waitScreen20 == null) {//GEN-END:|355-getter|0|355-preInit
            // write pre-init user code here
            waitScreen20 = new WaitScreen(getDisplay());//GEN-BEGIN:|355-getter|1|355-postInit
            waitScreen20.setTitle("waitScreen20");
            waitScreen20.setCommandListener(this);
            waitScreen20.setTask(getTask21());//GEN-END:|355-getter|1|355-postInit
            // write post-init user code here
        }//GEN-BEGIN:|355-getter|2|
        return waitScreen20;
    }
    //</editor-fold>//GEN-END:|355-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: task21 ">//GEN-BEGIN:|358-getter|0|358-preInit
    /**
     * Returns an initiliazed instance of task21 component.
     * @return the initialized component instance
     */
    public SimpleCancellableTask getTask21() {
        if (task21 == null) {//GEN-END:|358-getter|0|358-preInit
            // write pre-init user code here
            task21 = new SimpleCancellableTask();//GEN-BEGIN:|358-getter|1|358-execute
            task21.setExecutable(new org.netbeans.microedition.util.Executable() {
                public void execute() throws Exception {//GEN-END:|358-getter|1|358-execute
                    // write task-execution user code here

                }//GEN-BEGIN:|358-getter|2|358-postInit
            });//GEN-END:|358-getter|2|358-postInit
            // write post-init user code here
        }//GEN-BEGIN:|358-getter|3|
        return task21;
    }
    //</editor-fold>//GEN-END:|358-getter|3|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: list4 ">//GEN-BEGIN:|363-getter|0|363-preInit
    /**
     * Returns an initiliazed instance of list4 component.
     * @return the initialized component instance
     */
    public List getList4() {
        if (list4 == null) {//GEN-END:|363-getter|0|363-preInit
            // write pre-init user code here
            list4 = new List("list4", Choice.IMPLICIT);//GEN-BEGIN:|363-getter|1|363-postInit
            list4.append("savessw1", null);
            list4.append("savessw2", null);
            list4.append("savessw", null);
            list4.setCommandListener(this);
            list4.setSelectedFlags(new boolean[] { false, false, false });//GEN-END:|363-getter|1|363-postInit
            // write post-init user code here
        }//GEN-BEGIN:|363-getter|2|
        return list4;
    }
    //</editor-fold>//GEN-END:|363-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Method: list4Action ">//GEN-BEGIN:|363-action|0|363-preAction
    /**
     * Performs an action assigned to the selected list element in the list4 component.
     */
    public void list4Action() {//GEN-END:|363-action|0|363-preAction
        // enter pre-action user code here
        String __selectedString = getList4().getString(getList4().getSelectedIndex());//GEN-BEGIN:|363-action|1|366-preAction
        if (__selectedString != null) {
            if (__selectedString.equals("savessw1")) {//GEN-END:|363-action|1|366-preAction
                // write pre-action user code here
                switchDisplayable(null, getWaitScreen14());//GEN-LINE:|363-action|2|366-postAction
                // write post-action user code here
            } else if (__selectedString.equals("savessw2")) {//GEN-LINE:|363-action|3|367-preAction
                // write pre-action user code here
                switchDisplayable(null, getWaitScreen14());//GEN-LINE:|363-action|4|367-postAction
                // write post-action user code here
            } else if (__selectedString.equals("savessw")) {//GEN-LINE:|363-action|5|371-preAction
                // write pre-action user code here
                switchDisplayable(null, getWaitScreen14());//GEN-LINE:|363-action|6|371-postAction
                // write post-action user code here
            }//GEN-BEGIN:|363-action|7|363-postAction
        }//GEN-END:|363-action|7|363-postAction
        // enter post-action user code here
    }//GEN-BEGIN:|363-action|8|
    //</editor-fold>//GEN-END:|363-action|8|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: list5 ">//GEN-BEGIN:|368-getter|0|368-preInit
    /**
     * Returns an initiliazed instance of list5 component.
     * @return the initialized component instance
     */
    public List getList5() {
        if (list5 == null) {//GEN-END:|368-getter|0|368-preInit
            // write pre-init user code here
            list5 = new List("list5", Choice.IMPLICIT);//GEN-BEGIN:|368-getter|1|368-postInit
            list5.append("savessw1", null);
            list5.append("savessw2", null);
            list5.append("savessw", null);
            list5.setCommandListener(this);
            list5.setSelectedFlags(new boolean[] { false, false, false });//GEN-END:|368-getter|1|368-postInit
            // write post-init user code here
        }//GEN-BEGIN:|368-getter|2|
        return list5;
    }
    //</editor-fold>//GEN-END:|368-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Method: list5Action ">//GEN-BEGIN:|368-action|0|368-preAction
    /**
     * Performs an action assigned to the selected list element in the list5 component.
     */
    public void list5Action() {//GEN-END:|368-action|0|368-preAction
        // enter pre-action user code here
        String __selectedString = getList5().getString(getList5().getSelectedIndex());//GEN-BEGIN:|368-action|1|372-preAction
        if (__selectedString != null) {
            if (__selectedString.equals("savessw1")) {//GEN-END:|368-action|1|372-preAction
                // write pre-action user code here
                switchDisplayable(null, getWaitScreen15());//GEN-LINE:|368-action|2|372-postAction
                // write post-action user code here
            } else if (__selectedString.equals("savessw2")) {//GEN-LINE:|368-action|3|373-preAction
                // write pre-action user code here
                switchDisplayable(null, getWaitScreen15());//GEN-LINE:|368-action|4|373-postAction
                // write post-action user code here
            } else if (__selectedString.equals("savessw")) {//GEN-LINE:|368-action|5|374-preAction
                // write pre-action user code here
                switchDisplayable(null, getWaitScreen15());//GEN-LINE:|368-action|6|374-postAction
                // write post-action user code here
            }//GEN-BEGIN:|368-action|7|368-postAction
        }//GEN-END:|368-action|7|368-postAction
        // enter post-action user code here
    }//GEN-BEGIN:|368-action|8|
    //</editor-fold>//GEN-END:|368-action|8|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: Battle ">//GEN-BEGIN:|383-getter|0|383-preInit
    /**
     * Returns an initiliazed instance of Battle component.
     * @return the initialized component instance
     */
    public Command getBattle() {
        if (Battle == null) {//GEN-END:|383-getter|0|383-preInit
            // write pre-init user code here
            Battle = new Command("Ok", Command.OK, 0);//GEN-LINE:|383-getter|1|383-postInit
            // write post-init user code here
        }//GEN-BEGIN:|383-getter|2|
        return Battle;
    }
    //</editor-fold>//GEN-END:|383-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: waitScreen5 ">//GEN-BEGIN:|386-getter|0|386-preInit
    /**
     * Returns an initiliazed instance of waitScreen5 component.
     * @return the initialized component instance
     */
    public WaitScreen getWaitScreen5() {
        if (waitScreen5 == null) {//GEN-END:|386-getter|0|386-preInit
            // write pre-init user code here
            waitScreen5 = new WaitScreen(getDisplay());//GEN-BEGIN:|386-getter|1|386-postInit
            waitScreen5.setTitle("waitScreen5");
            waitScreen5.setCommandListener(this);
            waitScreen5.setTask(getTask5());//GEN-END:|386-getter|1|386-postInit
            // write post-init user code here
        }//GEN-BEGIN:|386-getter|2|
        return waitScreen5;
    }
    //</editor-fold>//GEN-END:|386-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: list6 ">//GEN-BEGIN:|390-getter|0|390-preInit
    /**
     * Returns an initiliazed instance of list6 component.
     * @return the initialized component instance
     */
    public List getList6() {
        if (list6 == null) {//GEN-END:|390-getter|0|390-preInit
            // write pre-init user code here
            list6 = new List("list6", Choice.IMPLICIT);//GEN-BEGIN:|390-getter|1|390-postInit
            list6.addCommand(getOkCommand3());
            list6.setCommandListener(this);//GEN-END:|390-getter|1|390-postInit
            // write post-init user code here
        }//GEN-BEGIN:|390-getter|2|
        return list6;
    }
    //</editor-fold>//GEN-END:|390-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Method: list6Action ">//GEN-BEGIN:|390-action|0|390-preAction
    /**
     * Performs an action assigned to the selected list element in the list6 component.
     */
    public void list6Action() {//GEN-END:|390-action|0|390-preAction
        // enter pre-action user code here
        String __selectedString = getList6().getString(getList6().getSelectedIndex());//GEN-LINE:|390-action|1|390-postAction
        // enter post-action user code here
    }//GEN-BEGIN:|390-action|2|
    //</editor-fold>//GEN-END:|390-action|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: waitScreen6 ">//GEN-BEGIN:|393-getter|0|393-preInit
    /**
     * Returns an initiliazed instance of waitScreen6 component.
     * @return the initialized component instance
     */
    public WaitScreen getWaitScreen6() {
        if (waitScreen6 == null) {//GEN-END:|393-getter|0|393-preInit
            // write pre-init user code here
            waitScreen6 = new WaitScreen(getDisplay());//GEN-BEGIN:|393-getter|1|393-postInit
            waitScreen6.setTitle("waitScreen6");
            waitScreen6.setCommandListener(this);
            waitScreen6.setTask(getTask6());//GEN-END:|393-getter|1|393-postInit
            // write post-init user code here
        }//GEN-BEGIN:|393-getter|2|
        return waitScreen6;
    }
    //</editor-fold>//GEN-END:|393-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: okCommand3 ">//GEN-BEGIN:|397-getter|0|397-preInit
    /**
     * Returns an initiliazed instance of okCommand3 component.
     * @return the initialized component instance
     */
    public Command getOkCommand3() {
        if (okCommand3 == null) {//GEN-END:|397-getter|0|397-preInit
            // write pre-init user code here
            okCommand3 = new Command("Ok", Command.OK, 0);//GEN-LINE:|397-getter|1|397-postInit
            // write post-init user code here
        }//GEN-BEGIN:|397-getter|2|
        return okCommand3;
    }
    //</editor-fold>//GEN-END:|397-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: task5 ">//GEN-BEGIN:|389-getter|0|389-preInit
    /**
     * Returns an initiliazed instance of task5 component.
     * @return the initialized component instance
     */
    public SimpleCancellableTask getTask5() {
        if (task5 == null) {//GEN-END:|389-getter|0|389-preInit
            // write pre-init user code here
            task5 = new SimpleCancellableTask();//GEN-BEGIN:|389-getter|1|389-execute
            task5.setExecutable(new org.netbeans.microedition.util.Executable() {
                public void execute() throws Exception {//GEN-END:|389-getter|1|389-execute
                    // write task-execution user code here
                     DEFENCESHOP();
                }//GEN-BEGIN:|389-getter|2|389-postInit
            });//GEN-END:|389-getter|2|389-postInit
            // write post-init user code here
        }//GEN-BEGIN:|389-getter|3|
        return task5;
    }
    //</editor-fold>//GEN-END:|389-getter|3|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: task6 ">//GEN-BEGIN:|396-getter|0|396-preInit
    /**
     * Returns an initiliazed instance of task6 component.
     * @return the initialized component instance
     */
    public SimpleCancellableTask getTask6() {
        if (task6 == null) {//GEN-END:|396-getter|0|396-preInit
            // write pre-init user code here
            task6 = new SimpleCancellableTask();//GEN-BEGIN:|396-getter|1|396-execute
            task6.setExecutable(new org.netbeans.microedition.util.Executable() {
                public void execute() throws Exception {//GEN-END:|396-getter|1|396-execute
                    // write task-execution user code here
                    BUYEDDEFENCE();
                }//GEN-BEGIN:|396-getter|2|396-postInit
            });//GEN-END:|396-getter|2|396-postInit
            // write post-init user code here
        }//GEN-BEGIN:|396-getter|3|
        return task6;
    }
    //</editor-fold>//GEN-END:|396-getter|3|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: list7 ">//GEN-BEGIN:|407-getter|0|407-preInit
    /**
     * Returns an initiliazed instance of list7 component.
     * @return the initialized component instance
     */
    public List getList7() {
        if (list7 == null) {//GEN-END:|407-getter|0|407-preInit
            // write pre-init user code here
            list7 = new List("list7", Choice.IMPLICIT);//GEN-BEGIN:|407-getter|1|407-postInit
            list7.append("HP = " + Integer.toString(HP), null);
            list7.append("XP = " + Integer.toString(XP), null);
            list7.append("XP NEEDED = " + Integer.toString(XPNEEDED), null);
            list7.append("ATTACK = " + Integer.toString(ATTACK), null);
            list7.append("DEFENCE = " + Integer.toString(DEFENCE), null);
            list7.append("GOLD = " + Integer.toString(GOLD), null);
            list7.append("BANK = " + Integer.toString(BANK), null);
            list7.append("LVL = " + Integer.toString(LVL), null);
            list7.addCommand(getExitCommand2());
            list7.setCommandListener(this);
            list7.setSelectedFlags(new boolean[] { false, false, false, false, false, false, false, false });//GEN-END:|407-getter|1|407-postInit
            // write post-init user code here
        }//GEN-BEGIN:|407-getter|2|
        return list7;
    }
    //</editor-fold>//GEN-END:|407-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Method: list7Action ">//GEN-BEGIN:|407-action|0|407-preAction
    /**
     * Performs an action assigned to the selected list element in the list7 component.
     */
    public void list7Action() {//GEN-END:|407-action|0|407-preAction
        // enter pre-action user code here
        String __selectedString = getList7().getString(getList7().getSelectedIndex());//GEN-BEGIN:|407-action|1|426-preAction
        if (__selectedString != null) {
            if (__selectedString.equals("HP = " + Integer.toString(HP))) {//GEN-END:|407-action|1|426-preAction
                // write pre-action user code here
//GEN-LINE:|407-action|2|426-postAction
                // write post-action user code here
            } else if (__selectedString.equals("XP = " + Integer.toString(XP))) {//GEN-LINE:|407-action|3|427-preAction
                // write pre-action user code here
//GEN-LINE:|407-action|4|427-postAction
                // write post-action user code here
            } else if (__selectedString.equals("XP NEEDED = " + Integer.toString(XPNEEDED))) {//GEN-LINE:|407-action|5|428-preAction
                // write pre-action user code here
//GEN-LINE:|407-action|6|428-postAction
                // write post-action user code here
            } else if (__selectedString.equals("ATTACK = " + Integer.toString(ATTACK))) {//GEN-LINE:|407-action|7|429-preAction
                // write pre-action user code here
//GEN-LINE:|407-action|8|429-postAction
                // write post-action user code here
            } else if (__selectedString.equals("DEFENCE = " + Integer.toString(DEFENCE))) {//GEN-LINE:|407-action|9|430-preAction
                // write pre-action user code here
//GEN-LINE:|407-action|10|430-postAction
                // write post-action user code here
            } else if (__selectedString.equals("GOLD = " + Integer.toString(GOLD))) {//GEN-LINE:|407-action|11|431-preAction
                // write pre-action user code here
//GEN-LINE:|407-action|12|431-postAction
                // write post-action user code here
            } else if (__selectedString.equals("BANK = " + Integer.toString(BANK))) {//GEN-LINE:|407-action|13|432-preAction
                // write pre-action user code here
//GEN-LINE:|407-action|14|432-postAction
                // write post-action user code here
            } else if (__selectedString.equals("LVL = " + Integer.toString(LVL))) {//GEN-LINE:|407-action|15|433-preAction
                // write pre-action user code here
//GEN-LINE:|407-action|16|433-postAction
                // write post-action user code here
            }//GEN-BEGIN:|407-action|17|407-postAction
        }//GEN-END:|407-action|17|407-postAction
        // enter post-action user code here
    }//GEN-BEGIN:|407-action|18|
    //</editor-fold>//GEN-END:|407-action|18|


    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: waitScreen21 ">//GEN-BEGIN:|410-getter|0|410-preInit
    /**
     * Returns an initiliazed instance of waitScreen21 component.
     * @return the initialized component instance
     */
    public WaitScreen getWaitScreen21() {
        if (waitScreen21 == null) {//GEN-END:|410-getter|0|410-preInit
            // write pre-init user code here
            waitScreen21 = new WaitScreen(getDisplay());//GEN-BEGIN:|410-getter|1|410-postInit
            waitScreen21.setTitle("waitScreen21");
            waitScreen21.setCommandListener(this);
            waitScreen21.setTask(getTask9());//GEN-END:|410-getter|1|410-postInit
            // write post-init user code here
        }//GEN-BEGIN:|410-getter|2|
        return waitScreen21;
    }
    //</editor-fold>//GEN-END:|410-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: task9 ">//GEN-BEGIN:|413-getter|0|413-preInit
    /**
     * Returns an initiliazed instance of task9 component.
     * @return the initialized component instance
     */
    public SimpleCancellableTask getTask9() {
        if (task9 == null) {//GEN-END:|413-getter|0|413-preInit
            // write pre-init user code here
            task9 = new SimpleCancellableTask();//GEN-BEGIN:|413-getter|1|413-execute
            task9.setExecutable(new org.netbeans.microedition.util.Executable() {
                public void execute() throws Exception {//GEN-END:|413-getter|1|413-execute
                    // write task-execution user code here
                    CHARINFO();
                }//GEN-BEGIN:|413-getter|2|413-postInit
            });//GEN-END:|413-getter|2|413-postInit
            // write post-init user code here
        }//GEN-BEGIN:|413-getter|3|
        return task9;
    }
    //</editor-fold>//GEN-END:|413-getter|3|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: waitScreen22 ">//GEN-BEGIN:|419-getter|0|419-preInit
    /**
     * Returns an initiliazed instance of waitScreen22 component.
     * @return the initialized component instance
     */
    public WaitScreen getWaitScreen22() {
        if (waitScreen22 == null) {//GEN-END:|419-getter|0|419-preInit
            // write pre-init user code here
            waitScreen22 = new WaitScreen(getDisplay());//GEN-BEGIN:|419-getter|1|419-postInit
            waitScreen22.setTitle("waitScreen22");
            waitScreen22.setCommandListener(this);
            waitScreen22.setTask(getTask22());//GEN-END:|419-getter|1|419-postInit
            // write post-init user code here
        }//GEN-BEGIN:|419-getter|2|
        return waitScreen22;
    }
    //</editor-fold>//GEN-END:|419-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: exitCommand2 ">//GEN-BEGIN:|417-getter|0|417-preInit
    /**
     * Returns an initiliazed instance of exitCommand2 component.
     * @return the initialized component instance
     */
    public Command getExitCommand2() {
        if (exitCommand2 == null) {//GEN-END:|417-getter|0|417-preInit
            // write pre-init user code here
            exitCommand2 = new Command("Exit", Command.EXIT, 0);//GEN-LINE:|417-getter|1|417-postInit
            // write post-init user code here
        }//GEN-BEGIN:|417-getter|2|
        return exitCommand2;
    }
    //</editor-fold>//GEN-END:|417-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: task22 ">//GEN-BEGIN:|422-getter|0|422-preInit
    /**
     * Returns an initiliazed instance of task22 component.
     * @return the initialized component instance
     */
    public SimpleCancellableTask getTask22() {
        if (task22 == null) {//GEN-END:|422-getter|0|422-preInit
            // write pre-init user code here
            task22 = new SimpleCancellableTask();//GEN-BEGIN:|422-getter|1|422-execute
            task22.setExecutable(new org.netbeans.microedition.util.Executable() {
                public void execute() throws Exception {//GEN-END:|422-getter|1|422-execute
                    // write task-execution user code here
                    list7.deleteAll();
                }//GEN-BEGIN:|422-getter|2|422-postInit
            });//GEN-END:|422-getter|2|422-postInit
            // write post-init user code here
        }//GEN-BEGIN:|422-getter|3|
        return task22;
    }
    //</editor-fold>//GEN-END:|422-getter|3|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: exitCommand3 ">//GEN-BEGIN:|438-getter|0|438-preInit
    /**
     * Returns an initiliazed instance of exitCommand3 component.
     * @return the initialized component instance
     */
    public Command getExitCommand3() {
        if (exitCommand3 == null) {//GEN-END:|438-getter|0|438-preInit
            // write pre-init user code here
            exitCommand3 = new Command("Exit", Command.EXIT, 0);//GEN-LINE:|438-getter|1|438-postInit
            // write post-init user code here
        }//GEN-BEGIN:|438-getter|2|
        return exitCommand3;
    }
    //</editor-fold>//GEN-END:|438-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: waitScreen23 ">//GEN-BEGIN:|443-getter|0|443-preInit
    /**
     * Returns an initiliazed instance of waitScreen23 component.
     * @return the initialized component instance
     */
    public WaitScreen getWaitScreen23() {
        if (waitScreen23 == null) {//GEN-END:|443-getter|0|443-preInit
            // write pre-init user code here
            waitScreen23 = new WaitScreen(getDisplay());//GEN-BEGIN:|443-getter|1|443-postInit
            waitScreen23.setTitle("waitScreen23");
            waitScreen23.setCommandListener(this);
            waitScreen23.setTask(getTask23());//GEN-END:|443-getter|1|443-postInit
            // write post-init user code here
        }//GEN-BEGIN:|443-getter|2|
        return waitScreen23;
    }
    //</editor-fold>//GEN-END:|443-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: list8 ">//GEN-BEGIN:|447-getter|0|447-preInit
    /**
     * Returns an initiliazed instance of list8 component.
     * @return the initialized component instance
     */
    public List getList8() {
        if (list8 == null) {//GEN-END:|447-getter|0|447-preInit
            // write pre-init user code here
            list8 = new List("list8", Choice.IMPLICIT);//GEN-BEGIN:|447-getter|1|447-postInit
            list8.append("HEAL SP needed: " + Integer.toString(HEALSP), null);
            list8.append("DOUBLE ATTACK SP needed: " + Integer.toString(DOUBLEATTACKSP), null);
            list8.append("GROUND SMASH SP needed: " + Integer.toString(GROUNDSMASHSP), null);
            list8.setCommandListener(this);
            list8.setSelectedFlags(new boolean[] { false, false, false });//GEN-END:|447-getter|1|447-postInit
            // write post-init user code here
        }//GEN-BEGIN:|447-getter|2|
        return list8;
    }
    //</editor-fold>//GEN-END:|447-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Method: list8Action ">//GEN-BEGIN:|447-action|0|447-preAction
    /**
     * Performs an action assigned to the selected list element in the list8 component.
     */
    public void list8Action() {//GEN-END:|447-action|0|447-preAction
        // enter pre-action user code here
        String __selectedString = getList8().getString(getList8().getSelectedIndex());//GEN-BEGIN:|447-action|1|459-preAction
        if (__selectedString != null) {
            if (__selectedString.equals("HEAL SP needed: " + Integer.toString(HEALSP))) {//GEN-END:|447-action|1|459-preAction
                // write pre-action user code here
                switchDisplayable(null, getWaitScreen24());//GEN-LINE:|447-action|2|459-postAction
                // write post-action user code here
            } else if (__selectedString.equals("DOUBLE ATTACK SP needed: " + Integer.toString(DOUBLEATTACKSP))) {//GEN-LINE:|447-action|3|460-preAction
                // write pre-action user code here
                switchDisplayable(null, getWaitScreen23());//GEN-LINE:|447-action|4|460-postAction
                // write post-action user code here
            } else if (__selectedString.equals("GROUND SMASH SP needed: " + Integer.toString(GROUNDSMASHSP))) {//GEN-LINE:|447-action|5|461-preAction
                // write pre-action user code here
                switchDisplayable(null, getWaitScreen23());//GEN-LINE:|447-action|6|461-postAction
                // write post-action user code here
            }//GEN-BEGIN:|447-action|7|447-postAction
        }//GEN-END:|447-action|7|447-postAction
        // enter post-action user code here
    }//GEN-BEGIN:|447-action|8|
    //</editor-fold>//GEN-END:|447-action|8|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: Skill ">//GEN-BEGIN:|441-getter|0|441-preInit
    /**
     * Returns an initiliazed instance of Skill component.
     * @return the initialized component instance
     */
    public Command getSkill() {
        if (Skill == null) {//GEN-END:|441-getter|0|441-preInit
            // write pre-init user code here
            Skill = new Command("Skill", Command.ITEM, 0);//GEN-LINE:|441-getter|1|441-postInit
            // write post-init user code here
        }//GEN-BEGIN:|441-getter|2|
        return Skill;
    }
    //</editor-fold>//GEN-END:|441-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: okCommand4 ">//GEN-BEGIN:|454-getter|0|454-preInit
    /**
     * Returns an initiliazed instance of okCommand4 component.
     * @return the initialized component instance
     */
    public Command getOkCommand4() {
        if (okCommand4 == null) {//GEN-END:|454-getter|0|454-preInit
            // write pre-init user code here
            okCommand4 = new Command("Ok", Command.OK, 0);//GEN-LINE:|454-getter|1|454-postInit
            // write post-init user code here
        }//GEN-BEGIN:|454-getter|2|
        return okCommand4;
    }
    //</editor-fold>//GEN-END:|454-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: task23 ">//GEN-BEGIN:|446-getter|0|446-preInit
    /**
     * Returns an initiliazed instance of task23 component.
     * @return the initialized component instance
     */
    public SimpleCancellableTask getTask23() {
        if (task23 == null) {//GEN-END:|446-getter|0|446-preInit
            // write pre-init user code here
            task23 = new SimpleCancellableTask();//GEN-BEGIN:|446-getter|1|446-execute
            task23.setExecutable(new org.netbeans.microedition.util.Executable() {
                public void execute() throws Exception {//GEN-END:|446-getter|1|446-execute
                    // write task-execution user code here
                    SKILLS();
                }//GEN-BEGIN:|446-getter|2|446-postInit
            });//GEN-END:|446-getter|2|446-postInit
            // write post-init user code here
        }//GEN-BEGIN:|446-getter|3|
        return task23;
    }
    //</editor-fold>//GEN-END:|446-getter|3|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: waitScreen24 ">//GEN-BEGIN:|462-getter|0|462-preInit
    /**
     * Returns an initiliazed instance of waitScreen24 component.
     * @return the initialized component instance
     */
    public WaitScreen getWaitScreen24() {
        if (waitScreen24 == null) {//GEN-END:|462-getter|0|462-preInit
            // write pre-init user code here
            waitScreen24 = new WaitScreen(getDisplay());//GEN-BEGIN:|462-getter|1|462-postInit
            waitScreen24.setTitle("waitScreen24");
            waitScreen24.setCommandListener(this);
            waitScreen24.setTask(getTask24());//GEN-END:|462-getter|1|462-postInit
            // write post-init user code here
        }//GEN-BEGIN:|462-getter|2|
        return waitScreen24;
    }
    //</editor-fold>//GEN-END:|462-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: task24 ">//GEN-BEGIN:|465-getter|0|465-preInit
    /**
     * Returns an initiliazed instance of task24 component.
     * @return the initialized component instance
     */
    public SimpleCancellableTask getTask24() {
        if (task24 == null) {//GEN-END:|465-getter|0|465-preInit
            // write pre-init user code here
            task24 = new SimpleCancellableTask();//GEN-BEGIN:|465-getter|1|465-execute
            task24.setExecutable(new org.netbeans.microedition.util.Executable() {
                public void execute() throws Exception {//GEN-END:|465-getter|1|465-execute
                    // write task-execution user code here
                    HEAL();
                }//GEN-BEGIN:|465-getter|2|465-postInit
            });//GEN-END:|465-getter|2|465-postInit
            // write post-init user code here
        }//GEN-BEGIN:|465-getter|3|
        return task24;
    }
    //</editor-fold>//GEN-END:|465-getter|3|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: list9 ">//GEN-BEGIN:|472-getter|0|472-preInit
    /**
     * Returns an initiliazed instance of list9 component.
     * @return the initialized component instance
     */
    public List getList9() {
        if (list9 == null) {//GEN-END:|472-getter|0|472-preInit
            // write pre-init user code here
            list9 = new List("list9", Choice.IMPLICIT);//GEN-BEGIN:|472-getter|1|472-postInit
            list9.append("normal blow", null);
            list9.append("heavy blow", null);
            list9.addCommand(getHelpCommand());
            list9.addCommand(getBackCommand1());
            list9.setCommandListener(this);
            list9.setSelectedFlags(new boolean[] { false, false });//GEN-END:|472-getter|1|472-postInit
            // write post-init user code here
        }//GEN-BEGIN:|472-getter|2|
        return list9;
    }
    //</editor-fold>//GEN-END:|472-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Method: list9Action ">//GEN-BEGIN:|472-action|0|472-preAction
    /**
     * Performs an action assigned to the selected list element in the list9 component.
     */
    public void list9Action() {//GEN-END:|472-action|0|472-preAction
        // enter pre-action user code here
        String __selectedString = getList9().getString(getList9().getSelectedIndex());//GEN-BEGIN:|472-action|1|478-preAction
        if (__selectedString != null) {
            if (__selectedString.equals("normal blow")) {//GEN-END:|472-action|1|478-preAction
                // write pre-action user code here
                switchDisplayable(null, getWaitScreen25());//GEN-LINE:|472-action|2|478-postAction
                // write post-action user code here
            } else if (__selectedString.equals("heavy blow")) {//GEN-LINE:|472-action|3|479-preAction
                // write pre-action user code here
                switchDisplayable(null, getWaitScreen25());//GEN-LINE:|472-action|4|479-postAction
                // write post-action user code here
            }//GEN-BEGIN:|472-action|5|472-postAction
        }//GEN-END:|472-action|5|472-postAction
        // enter post-action user code here
    }//GEN-BEGIN:|472-action|6|
    //</editor-fold>//GEN-END:|472-action|6|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: alert2 ">//GEN-BEGIN:|480-getter|0|480-preInit
    /**
     * Returns an initiliazed instance of alert2 component.
     * @return the initialized component instance
     */
    public Alert getAlert2() {
        if (alert2 == null) {//GEN-END:|480-getter|0|480-preInit
            // write pre-init user code here
            alert2 = new Alert("alert2", "you can choose a 2 sorts of attack, a normal blow: you hit normal and you have your normal defence, and a heavy blow: you hit more but you have lower defence", null, null);//GEN-BEGIN:|480-getter|1|480-postInit
            alert2.setTimeout(Alert.FOREVER);//GEN-END:|480-getter|1|480-postInit
            // write post-init user code here
        }//GEN-BEGIN:|480-getter|2|
        return alert2;
    }
    //</editor-fold>//GEN-END:|480-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: waitScreen25 ">//GEN-BEGIN:|482-getter|0|482-preInit
    /**
     * Returns an initiliazed instance of waitScreen25 component.
     * @return the initialized component instance
     */
    public WaitScreen getWaitScreen25() {
        if (waitScreen25 == null) {//GEN-END:|482-getter|0|482-preInit
            // write pre-init user code here
            waitScreen25 = new WaitScreen(getDisplay());//GEN-BEGIN:|482-getter|1|482-postInit
            waitScreen25.setTitle("waitScreen25");
            waitScreen25.setCommandListener(this);
            waitScreen25.setTask(getTask25());//GEN-END:|482-getter|1|482-postInit
            // write post-init user code here
        }//GEN-BEGIN:|482-getter|2|
        return waitScreen25;
    }
    //</editor-fold>//GEN-END:|482-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: helpCommand ">//GEN-BEGIN:|476-getter|0|476-preInit
    /**
     * Returns an initiliazed instance of helpCommand component.
     * @return the initialized component instance
     */
    public Command getHelpCommand() {
        if (helpCommand == null) {//GEN-END:|476-getter|0|476-preInit
            // write pre-init user code here
            helpCommand = new Command("Help", Command.HELP, 0);//GEN-LINE:|476-getter|1|476-postInit
            // write post-init user code here
        }//GEN-BEGIN:|476-getter|2|
        return helpCommand;
    }
    //</editor-fold>//GEN-END:|476-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: backCommand1 ">//GEN-BEGIN:|490-getter|0|490-preInit
    /**
     * Returns an initiliazed instance of backCommand1 component.
     * @return the initialized component instance
     */
    public Command getBackCommand1() {
        if (backCommand1 == null) {//GEN-END:|490-getter|0|490-preInit
            // write pre-init user code here
            backCommand1 = new Command("Back", Command.BACK, 0);//GEN-LINE:|490-getter|1|490-postInit
            // write post-init user code here
        }//GEN-BEGIN:|490-getter|2|
        return backCommand1;
    }
    //</editor-fold>//GEN-END:|490-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: task25 ">//GEN-BEGIN:|485-getter|0|485-preInit
    /**
     * Returns an initiliazed instance of task25 component.
     * @return the initialized component instance
     */
    public SimpleCancellableTask getTask25() {
        if (task25 == null) {//GEN-END:|485-getter|0|485-preInit
            // write pre-init user code here
            task25 = new SimpleCancellableTask();//GEN-BEGIN:|485-getter|1|485-execute
            task25.setExecutable(new org.netbeans.microedition.util.Executable() {
                public void execute() throws Exception {//GEN-END:|485-getter|1|485-execute
                    // write task-execution user code here
                     ATTACKTYPE();
                }//GEN-BEGIN:|485-getter|2|485-postInit
            });//GEN-END:|485-getter|2|485-postInit
            // write post-init user code here
        }//GEN-BEGIN:|485-getter|3|
        return task25;
    }
    //</editor-fold>//GEN-END:|485-getter|3|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: list ">//GEN-BEGIN:|497-getter|0|497-preInit
    /**
     * Returns an initiliazed instance of list component.
     * @return the initialized component instance
     */
    public List getList() {
        if (list == null) {//GEN-END:|497-getter|0|497-preInit
            // write pre-init user code here
            list = new List("list", Choice.IMPLICIT);//GEN-BEGIN:|497-getter|1|497-postInit
            list.addCommand(getExitCommand4());
            list.setCommandListener(this);//GEN-END:|497-getter|1|497-postInit
            // write post-init user code here
        }//GEN-BEGIN:|497-getter|2|
        return list;
    }
    //</editor-fold>//GEN-END:|497-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Method: listAction ">//GEN-BEGIN:|497-action|0|497-preAction
    /**
     * Performs an action assigned to the selected list element in the list component.
     */
    public void listAction() {//GEN-END:|497-action|0|497-preAction
        // enter pre-action user code here
        String __selectedString = getList().getString(getList().getSelectedIndex());//GEN-LINE:|497-action|1|497-postAction
        // enter post-action user code here
    }//GEN-BEGIN:|497-action|2|
    //</editor-fold>//GEN-END:|497-action|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: waitScreen26 ">//GEN-BEGIN:|500-getter|0|500-preInit
    /**
     * Returns an initiliazed instance of waitScreen26 component.
     * @return the initialized component instance
     */
    public WaitScreen getWaitScreen26() {
        if (waitScreen26 == null) {//GEN-END:|500-getter|0|500-preInit
            // write pre-init user code here
            waitScreen26 = new WaitScreen(getDisplay());//GEN-BEGIN:|500-getter|1|500-postInit
            waitScreen26.setTitle("waitScreen26");
            waitScreen26.setCommandListener(this);
            waitScreen26.setTask(getTask26());//GEN-END:|500-getter|1|500-postInit
            // write post-init user code here
        }//GEN-BEGIN:|500-getter|2|
        return waitScreen26;
    }
    //</editor-fold>//GEN-END:|500-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: task26 ">//GEN-BEGIN:|503-getter|0|503-preInit
    /**
     * Returns an initiliazed instance of task26 component.
     * @return the initialized component instance
     */
    public SimpleCancellableTask getTask26() {
        if (task26 == null) {//GEN-END:|503-getter|0|503-preInit
            // write pre-init user code here
            task26 = new SimpleCancellableTask();//GEN-BEGIN:|503-getter|1|503-execute
            task26.setExecutable(new org.netbeans.microedition.util.Executable() {
                public void execute() throws Exception {//GEN-END:|503-getter|1|503-execute
                    // write task-execution user code here
                }//GEN-BEGIN:|503-getter|2|503-postInit
            });//GEN-END:|503-getter|2|503-postInit
            // write post-init user code here
        }//GEN-BEGIN:|503-getter|3|
        return task26;
    }
    //</editor-fold>//GEN-END:|503-getter|3|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: exitCommand4 ">//GEN-BEGIN:|506-getter|0|506-preInit
    /**
     * Returns an initiliazed instance of exitCommand4 component.
     * @return the initialized component instance
     */
    public Command getExitCommand4() {
        if (exitCommand4 == null) {//GEN-END:|506-getter|0|506-preInit
            // write pre-init user code here
            exitCommand4 = new Command("Exit", Command.EXIT, 0);//GEN-LINE:|506-getter|1|506-postInit
            // write post-init user code here
        }//GEN-BEGIN:|506-getter|2|
        return exitCommand4;
    }
    //</editor-fold>//GEN-END:|506-getter|2|

    /**
     * Returns a display instance.
     * @return the display instance.
     */
    public Display getDisplay () {
        return Display.getDisplay(this);
    }

    /**
     * Exits MIDlet.
     */
    public void exitMIDlet() {
        switchDisplayable (null, null);
        destroyApp(true);
        notifyDestroyed();
    }

    /**
     * Called when MIDlet is started.
     * Checks whether the MIDlet have been already started and initialize/starts or resumes the MIDlet.
     */
    public void startApp() {
        if (midletPaused) {
           resumeMIDlet ();
        } else {
            initialize ();
            startMIDlet ();
        }
        midletPaused = false;
    }

    /**
     * Called when MIDlet is paused.
     */
    public void pauseApp() {
        midletPaused = true;
    }

    /**
     * Called to signal the MIDlet to terminate.
     * @param unconditional if true, then the MIDlet has to be unconditionally terminated and all resources has to be released.
     */
    public void destroyApp(boolean unconditional) {
    }
     public void refresHP(){
    townactions.set(1,"you HP is " + Integer.toString(HP), null);
    townactions.set(0,"you level is " + Integer.toString(LVL), null);
}
//<editor-fold defaultstate="collapsed" desc="TRAVEL SYSTEM">
void travel(){
    form1.addCommand(okCommand1);
    form1.removeCommand(Battle);
    Random random = new Random();
    int r = random.nextInt(5);

if (r == 1) {
stringItem.setText("you are traveling by the road, the sight is great!");
} else if (r == 2) {
        Random rgold = new Random();
    int rgoldr = rgold.nextInt(3);
    if (rgoldr == 1){
        GOLDFOUND = 1;
    } else {
        GOLDFOUND = 10;
    }
    stringItem.setText("you found " + GOLDFOUND + " coins by the road!, you fill yourself a little lucky!");
    GOLD = GOLD+GOLDFOUND;
} else if (r == 3) {
        stringItem.setText("nothing happens, you feel sad...");
} else if (r == 4) {
stringItem.setText("a monster appared! get ready to battle!");
form1.removeCommand(okCommand1);
form1.addCommand(Battle);
switchDisplayable(null, getWaitScreen9());

} else if (r == 0) {
    if (townnum == 0 ) {
        townnum++;
    }
    stringItem.setText("you went to the other town, press stop to go there...");
     form1.removeCommand(okCommand1);
        form1.addCommand(stopCommand1);
}
}
//</editor-fold>
//<editor-fold defaultstate="collapsed" desc="INN SYSTEM">
//<editor-fold defaultstate="collapsed" desc="rumors">
void rumors(){
    if (townnum == 0) {
    Random random = new Random();
    int r = random.nextInt(3);
    if (r == 1) {
        stringItem4.setText("hey, i'm billy bob! you want some rumors, or not? now i'm giving you some "
                + "they say you can find money on the way to another town, I don't know how much but it is enough to pay"
                + " the inn..., yea I wan't to be rich!");
    } else if (r == 2){
        stringItem4.setText("hey, i'm billy bob! you want some rumors, or not? now i'm giving you some "
                + "this is a nice town, but they say there is another town to visit, but it's there much nicer then here!");
    } else if (r == 3){
        stringItem4.setText("hey, i'm billy bob! you want some rumors, or not? now i'm giving you some "
                + "in a other town there is a cheaper inn, but they don't have so much people like me that tell you something"
                + " and also the chambers are more dirty... what sould I chose?");
    } else {
        stringItem4.setText("hey, i'm billy bob! but sorry now I don't have much to tell you so bye!");
    }
} else if (townnum == 1){
    Random random = new Random();
    int r = random.nextInt(2);
    if (r == 1) {
        stringItem4.setText("hey, i'm smilly! you want some rumors, or not? now i'm giving you some "
                + "the people are here not so nice but the inn here is cheaper and you can buy bows here!"
                + "get a bow and schoot!");
    } else {
        stringItem4.setText("hey, i'm smilly! but sorry now I don't have much to tell you so bye!");
    }
}
    }
//</editor-fold >
//<editor-fold defaultstate="collapsed" desc="inn">
     public void inn(){

                            if (townnum == 0) {
         if (choiceGroup.isSelected(0)) {
             if (GOLD >= 10){
                 HP = MAXHP;
                        TP = MAXTP;
                        GOLD = GOLD-MAGONIINN;
                    } else {
                 
                 return;
             }
                    } else {
                        return;

                    }
         } else if (townnum == 1 || townnum >= 1) {
             if (GOLD >= 5) {
                 
             if (choiceGroup.isSelected(0)) {
                 HP = MAXHP;
                        TP = MAXTP;
                        GOLD = GOLD-TIMMINN;
                    } else {
                        return;
                    }
         } else {
                 return;
         }
         }

     }
     //</editor-fold>
//</editor-fold>
//<editor-fold defaultstate="collapsed" desc="BATTLE SYSTEM">
//<editor-fold defaultstate="collapsed" desc="arena">
     public void arena(){
    list1.addCommand(attack);
    Random random = new Random();
    int mob = random.nextInt(2);

    if (mob == 0) {
        mobstr = "Small Slime";
        SLIMEHP = 10;
        MAXSLIMEHP = 10;
        MOBATTACK = 5;
        SLIMEXP = 5;
         } else if (mob == 1) {
        mobstr = "Shade";
        SLIMEHP = 10;
        MAXSLIMEHP = 10;
        MOBATTACK = 5;
        SLIMEXP = 5;
    } else if (mob == 2) {
        mobstr = "Slime";
        SLIMEHP = 10;
        MAXSLIMEHP = 10;
        MOBATTACK = 5;
        SLIMEXP = 5;
    }
        list1.insert(list1num, "you are fighting a " + mobstr, null);
        list1num++;
        list1.addCommand(attack);
SLIMEHP = MAXSLIMEHP;
     }
     //</editor-fold>
//<editor-fold defaultstate="collapsed" desc="attack">
     public void attack(){
         MOBMINHP = ATTACK+WEAPONATTACK;
         MEMINHP = DEFENCE-MOBATTACK;
         Random random = new Random();
         Random random1 = new Random();
         Random random2 = new Random();
         Random random3 = new Random();
         int MINHP = random.nextInt(MOBMINHP);
         int YOUMINHP = random1.nextInt(MEMINHP);
         int GOLDADD = random2.nextInt(50);
         int GOLDLOST = random3.nextInt(50);
         if (SLIMEHP <= 0) {
              list1.removeCommand(attack);
             list1.insert(list1num,"you have defeated the " + mobstr, null);
             list1num++;
             list1.insert(list1num,"you have got " + GOLDADD + " gold", null);
             list1num++;
             GOLD = GOLD+GOLDADD;
             XP = XP+SLIMEXP;
             XPNEEDED = XPNEEDED-SLIMEXP;
             list1num = 0;
             if (XPNEEDED <= 0) {
             LVL = LVL+1;
    LVLS = LVL;
    ATTACK = ATTACK+(LVLS*2);
    LVLS = LVL;
    NORMALATTACK = NORMALATTACK+(LVLS*2);
    LVLS = LVL;
    HEAVYATTACK = HEAVYATTACK+(LVLS*2);
    LVLS = LVL;
    DEFENCE = DEFENCE+(LVLS*2);
    LVLS = LVL;
    NORMALDEFENCE = NORMALDEFENCE+(LVLS*2);
    LVLS = LVL;
    HEAVYDEFENCE = HEAVYDEFENCE+(LVLS*2);
    LVLS = LVL;
    HP = HP+(LVLS*10);
    LVLS = LVL;
    SP = SP+(LVLS*10);
    LVLS = LVL;
MAXHP = MAXHP+(LVLS*10);
LVLS = LVL;
MAXSP = MAXSP+(LVLS*10);
XPLIST();
}
         } else if(HP <= 0) {
             list1.insert(list1num,"you have been defeated...", null);
             list1num++;
             list1.insert(list1num,"you have lost " + GOLDLOST + " gold", null);
             list1num++;
             list1.insert(list1num,"you have got free inn rest...", null);
             GOLD = GOLD-GOLDLOST;
             HP = MAXHP;
             list1num = 0;
             list1.removeCommand(attack);
             
                   } else {
             SLIMEHP = SLIMEHP-MINHP;
         HP = HP-YOUMINHP;
         list1.insert(list1num, "you hit the " + mobstr + " with " + MINHP, null);
         list1num++;

         list1.insert(list1num, "the " + mobstr + " hit you with " + YOUMINHP, null);
         list1num++;
                   }

     }
     //</editor-fold>  
//<editor-fold defaultstate="collapsed" desc="XP needed list">    
public void XPLIST(){
if (LVL == 1) {
    XPNEEDED = 83;
} else if (LVL == 2) {
    XPNEEDED = 174;
} else if (LVL == 3) {
    XPNEEDED = 276;
} else if (LVL == 4) {
    XPNEEDED = 388;
} else if (LVL == 5) {
    XPNEEDED = 512;
} else if (LVL == 6) {
    XPNEEDED = 650;
} else if (LVL == 7) {
    XPNEEDED = 801;
} else if (LVL == 8) {
    XPNEEDED = 969;
}  else if (LVL == 9) {
    XPNEEDED = 1154;
} else if (LVL == 10) {
    XPNEEDED = 1358;
} else if (LVL == 11) {
    XPNEEDED = 1584;
} else if (LVL == 12) {
    XPNEEDED = 1833;
} else if (LVL == 13) {
    XPNEEDED = 2107;
} else if (LVL == 14) {
    XPNEEDED = 2411;
} else if (LVL == 15) {
    XPNEEDED = 2746;
} else if (LVL == 16) {
    XPNEEDED = 3115;
} else if (LVL == 17) {
    XPNEEDED = 3523;
} else if (LVL == 18) {
    XPNEEDED = 3973;
} else if (LVL == 19) {
    XPNEEDED = 4470;
}


}
//</editor-fold>
//<editor-fold defaultstate="collapsed" desc="SKILLS">
void SKILLS(){
    int SKILLHIT = 0;
    String SKILL = "";
    if (list8.isSelected(1)){
        if (SP >= DOUBLEATTACKSP) {
        SKILLHIT = DOUBLEATTACK;
        SP = SP-DOUBLEATTACKSP;
        SKILL = "DOUBLE ATTACK";
        } else {
            
            list1.insert(list1num,"you don't have enough SP left", null);
            list1num++;
            return;
        }
    } else if (list8.isSelected(2)) {
        if (SP >= GROUNDSMASHSP) {
        SKILLHIT = GROUNDSMASH;
        SKILL = "GROUND SMASH";
    }  else {
            
            list1.insert(list1num,"you don't have enough SP left", null);
            list1num++;
            return;

    }
    }
    MOBMINHP = ATTACK+WEAPONATTACK;
         MEMINHP = DEFENCE-MOBATTACK;
         Random random = new Random();
         Random random1 = new Random();
         Random random2 = new Random();
         Random random3 = new Random();
         int MINHP = random.nextInt(MOBMINHP);
         int YOUMINHP = random1.nextInt(MEMINHP);
         int GOLDADD = random2.nextInt(50);
         int GOLDLOST = random3.nextInt(50);
         if (SLIMEHP <= 0) {
              list1.removeCommand(attack);
             list1.insert(list1num,"you have defeated the " + mobstr, null);
             list1num++;
             list1.insert(list1num,"you have got " + GOLDADD + " gold", null);
             list1num++;
             GOLD = GOLD+GOLDADD;
             XP = XP+SLIMEXP;
             XPNEEDED = XPNEEDED-SLIMEXP;
             if (XPNEEDED <= 0) {
             LVL = LVL+1;
    LVLS = LVL;
    ATTACK = ATTACK+(LVLS*2);
    LVLS = LVL;
    NORMALATTACK = NORMALATTACK+(LVLS*2);
    LVLS = LVL;
    HEAVYATTACK = HEAVYATTACK+(LVLS*2);
    LVLS = LVL;
    DEFENCE = DEFENCE+(LVLS*2);
    LVLS = LVL;
    NORMALDEFENCE = NORMALDEFENCE+(LVLS*2);
    LVLS = LVL;
    HEAVYDEFENCE = HEAVYDEFENCE+(LVLS*2);
    LVLS = LVL;
    HP = HP+(LVLS*10);
    LVLS = LVL;
    SP = SP+(LVLS*10);
    LVLS = LVL;
MAXHP = MAXHP+(LVLS*10);
LVLS = LVL;
MAXSP = MAXSP+(LVLS*10);
XPLIST();
}
         } else if(HP <= 0) {
             list1.insert(list1num,"you have been defeated...", null);
             list1num++;
             list1.insert(list1num,"you have lost " + GOLDLOST + " gold", null);
             list1num++;
             list1.insert(list1num,"you have got free inn rest...", null);
             GOLD = GOLD-GOLDLOST;
             HP = MAXHP;
             list1num = 0;
             list1.removeCommand(attack);

                   } else {

             SLIMEHP = SLIMEHP-MINHP;
             SLIMEHP = SLIMEHP-SKILLHIT;
             HP = HP-YOUMINHP;
         list1.insert(list1num, "you use " + SKILL, null);
         list1num++;
         list1.insert(list1num, "you hit the" + mobstr + " with " + MOBMINHP, null);
         list1num++;
         list1.insert(list1num, "the " + mobstr + " hit you with " + YOUMINHP, null);
         list1num++;
                   }

}
void HEAL(){
    if (SP >= HEALSP) {
 HP = HP+HEAL;
 SP = SP-HEALSP;
 list1.insert(list1num, "you heal yourself with " + Integer.toString(HEAL), null);
 list1num++;
 return;
} else {
list1num++;list1.insert(list1num,"you don't have enough SP left", null);
list1num++;
 return;
}
}
//</editor-fold>
//<editor-fold defaultstate="collapsed" desc="ATTACK TYPE choose">
void ATTACKTYPE(){
    if (list9.isSelected(0)) {
        ATTACK = NORMALATTACK;
        DEFENCE = NORMALDEFENCE;
        
    } else if (list9.isSelected(1)) {
        ATTACK = HEAVYATTACK;
        DEFENCE = HEAVYDEFENCE;
        
    }
}
//</editor-fold>
//</editor-fold>
//<editor-fold defaultstate="collapsed" desc="SAVING & LOADING">
//<editor-fold defaultstate="collapsed" desc="delete save data SLOT name needed">
void DELSAVEDATA(String SLOT) throws IOException{
     try {

        RecordStore.deleteRecordStore(SLOT);

    } catch (RecordStoreFullException ex) {

    } catch (RecordStoreNotFoundException ex) {

    } catch (RecordStoreException ex) {

    }
     saveDATA(SLOT);
}
//</editor-fold>
//<editor-fold defaultstate="collapsed" desc="save data SLOT name needed">
void saveDATA(String SLOT) throws IOException{
    try {
        RecordStore savessw = RecordStore.openRecordStore(SLOT, true);
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        DataOutputStream os = new DataOutputStream(baos);
        os.writeInt(HP);
        os.writeInt(LVL);
        os.writeInt(GOLD);
        os.writeInt(BANK);
        os.writeInt(ATTACK);
        os.writeInt(WEAPONATTACK);
        os.writeInt(townnum);
        os.writeInt(DEFENCE);
        os.writeInt(SP);
        os.close();
        byte[] data = baos.toByteArray();
        int id = savessw.addRecord(data, 0, data.length);
        savessw.closeRecordStore();
    } catch (RecordStoreFullException ex) {

    } catch (RecordStoreNotFoundException ex) {

    } catch (RecordStoreException ex) {

    }
}
//</editor-fold>
//<editor-fold defaultstate="collapsed" desc="read data recordID and SLOT name needed">
int readFromDisk(int RecordID, String SLOT) throws IOException {
    boolean flag = true;
    while (flag) {
        try {
            RecordStore savessw = RecordStore.openRecordStore(SLOT, true);

            byte[] data = savessw.getRecord(RecordID);
            flag = false;
            DataInputStream is = new DataInputStream(new ByteArrayInputStream(data));
            HP = is.readInt();
            LVL = is.readInt();
            GOLD = is.readInt();
            BANK = is.readInt();
            ATTACK = is.readInt();
            WEAPONATTACK = is.readInt();
            townnum = is.readInt();
            DEFENCE = is.readInt();
            SP = is.readInt();
            is.close();
            savessw.closeRecordStore();
        } catch (RecordStoreFullException ex) {
        } catch (RecordStoreNotFoundException ex) {
        } catch (InvalidRecordIDException ex) {
            RecordID++;
        } catch (RecordStoreException ex) {
        }
    }
    return (++RecordID);
}
//</editor-fold>
//<editor-fold defaultstate="collapsed" desc="DELETE SAVE DATA">
void deleteDATA() throws IOException{
    try {        
        RecordStore.deleteRecordStore("savessw");
        RecordStore.deleteRecordStore("savessw1");
        RecordStore.deleteRecordStore("savessw2");
    } catch (RecordStoreFullException ex) {
    } catch (RecordStoreNotFoundException ex) {
    } catch (RecordStoreException ex) {
    }
}
//</editor-fold>
//</editor-fold>
//<editor-fold defaultstate="collapsed" desc="SHOP SYSTEM">
//<editor-fold defaultstate="collapsed" desc="WEAPON shop add weapons to list 3">
public void WEAPONSHOP(){
    int list3num = 1;
    list3.insert(0,"weapon:", null);
    if (townnum == 0) {
        if (LVL >= 1) {
        list3.insert(list3num, weapon1str + " price " + Integer.toString(weapon1price) , null);
        list3num++;
        } else if (LVL >= 2) {
        list3.insert(list3num, weapon2str + " price " + Integer.toString(weapon2price) , null);
        list3num++;
        } else if (LVL >= 3) {
        list3.insert(list3num, weapon3str + " price " + Integer.toString(weapon3price) , null);
        list3num++;
        } else if (LVL >= 4) {
        list3.insert(list3num, weapon4str + " price " + Integer.toString(weapon4price) , null);
        list3num++;
        } else if (LVL >=5) {
        list3.insert(list3num, weapon5str + " price " + Integer.toString(weapon5price) , null);
        list3num++;
        }
        list3num = 1;
    }
    if (townnum == 1) {
        if (LVL >= 1) {
        list3.insert(list3num, weapon6str + " price " + Integer.toString(weapon6price) , null);
        list3num++;
        } else if (LVL >= 2) {
        list3.insert(list3num, weapon7str + " price " + Integer.toString(weapon7price) , null);
        list3num++;
        } else if (LVL >= 3) {
        list3.insert(list3num, weapon8str + " price " + Integer.toString(weapon8price) , null);
        list3num++;
        } else if (LVL >= 4) {
        list3.insert(list3num, weapon9str + " price " + Integer.toString(weapon9price) , null);
        list3num++;
        } else if (LVL >= 5) {
        list3.insert(list3num, weapon10str + " price " + Integer.toString(weapon10price) , null);
        list3num++;
        }
        list3num = 1;
    }

}
//</editor-fold>
//<editor-fold defaultstate="collapsed" desc="Buy WEAPON index by list3 selected number">
public void BUYEDWEAPON(){
     if (townnum == 0) {
    if (list3.isSelected(1)) {
        if (GOLD >= weapon1price) {
        GOLD = GOLD-weapon1price;
        WEAPONATTACK = weapon1attack;
    } }
    if (list3.isSelected(2)) {
        if (GOLD >= weapon2price) {
        GOLD = GOLD-weapon2price;
        WEAPONATTACK = weapon2attack;
    } }
    if (list3.isSelected(3)) {
        if (GOLD >= weapon3price) {
        GOLD = GOLD-weapon3price;
        WEAPONATTACK = weapon3attack;
    } }
    if (list3.isSelected(4)) {
        if (GOLD >= weapon4price) {
        GOLD = GOLD-weapon4price;
        WEAPONATTACK = weapon4attack;
    } }
    if (list3.isSelected(5)) {
        if (GOLD >= weapon5price) {
        GOLD = GOLD-weapon5price;
        WEAPONATTACK = weapon5attack;
    } }
}     if (townnum == 1) {
    if (list3.isSelected(1)) {
        if (GOLD >= weapon6price) {
        GOLD = GOLD-weapon6price;
        WEAPONATTACK = weapon6attack;
    } }
    if (list3.isSelected(2)) {
        if (GOLD >= weapon7price) {
        GOLD = GOLD-weapon7price;
        WEAPONATTACK = weapon7attack;
    } }
    if (list3.isSelected(3)) {
        if (GOLD >= weapon8price) {
        GOLD = GOLD-weapon8price;
        WEAPONATTACK = weapon8attack;
    } }
    if (list3.isSelected(4)) {
        if (GOLD >= weapon9price) {
        GOLD = GOLD-weapon9price;
        WEAPONATTACK = weapon9attack;
    } }
    if (list3.isSelected(5)) {
        if (GOLD >= weapon10price) {
        GOLD = GOLD-weapon10price;
        WEAPONATTACK = weapon10attack;
    } }
}

    }
//</editor-fold>
//<editor-fold defaultstate="collapsed" desc="ARMOUR shop add armour to list 6">
public void DEFENCESHOP(){
    int list3num = 1;
    list6.insert(0,"armour:", null);
    if (townnum == 0) {
        if (LVL >= 1) {
        list6.insert(list3num, defence1str + " price " + Integer.toString(defence1price) , null);
        list3num++;
        } else if (LVL >= 2) {
        list6.insert(list3num, defence2str + " price " + Integer.toString(defence2price) , null);
        list3num++;
        } else if (LVL >= 3) {
        list6.insert(list3num, defence3str + " price " + Integer.toString(defence3price) , null);
        list3num++;
        } else if (LVL >= 4) {
        list6.insert(list3num, defence4str + " price " + Integer.toString(defence4price) , null);
        list3num++;
        } else if (LVL >= 5) {
        list6.insert(list3num, defence5str + " price " + Integer.toString(defence5price) , null);
        list3num++;
        }
        list3num = 1;
    }
    if (townnum == 1) {
        if (LVL >= 1) {
        list6.insert(list3num, defence6str + " price " + Integer.toString(defence6price) , null);
        list3num++;
        } else if (LVL >= 2) {
        list6.insert(list3num, defence7str + " price " + Integer.toString(defence7price) , null);
        list3num++;
        } else if (LVL >= 3) {
        list6.insert(list3num, defence8str + " price " + Integer.toString(defence8price) , null);
        list3num++;
        } else if (LVL >= 4) {
        list6.insert(list3num, defence9str + " price " + Integer.toString(defence9price) , null);
        list3num++;
        } else if (LVL >= 5) {
        list6.insert(list3num, defence10str + " price " + Integer.toString(defence10price) , null);
        list3num++;
        }
        list3num = 1;
    }

}
//</editor-fold>
//<editor-fold defaultstate="collapsed" desc="buy ARMOUR index by list 6 selected number">
public void BUYEDDEFENCE(){
     if (townnum == 0) {
    if (list6.isSelected(1)) {
        if (GOLD >= defence1price) {
        GOLD = GOLD-defence1price;
        DEFENCE = defence1attack;
    } }
    if (list6.isSelected(2)) {
        if (GOLD >= defence2price) {
        GOLD = GOLD-defence2price;
        DEFENCE = defence2attack;
    } }
    if (list6.isSelected(3)) {
        if (GOLD >= defence3price) {
        GOLD = GOLD-defence3price;
        DEFENCE = defence3attack;
    } }
    if (list6.isSelected(4)) {
        if (GOLD >= defence4price) {
        GOLD = GOLD-defence4price;
        DEFENCE = defence4attack;
    } }
    if (list6.isSelected(5)) {
        if (GOLD >= defence5price) {
        GOLD = GOLD-defence5price;
        DEFENCE = defence5attack;
    } }
}     if (townnum == 1) {
    if (list6.isSelected(1)) {
        if (GOLD >= defence6price) {
        GOLD = GOLD-defence6price;
        DEFENCE = defence6attack;
    } }
    if (list6.isSelected(2)) {
        if (GOLD >= defence7price) {
        GOLD = GOLD-defence7price;
        DEFENCE = defence7attack;
    } }
    if (list6.isSelected(3)) {
        if (GOLD >= defence8price) {
        GOLD = GOLD-defence8price;
        DEFENCE = defence8attack;
    } }
    if (list6.isSelected(4)) {
        if (GOLD >= defence9price) {
        GOLD = GOLD-defence9price;
        DEFENCE = defence9attack;
    } }
    if (list6.isSelected(5)) {
        if (GOLD >= defence10price) {
        GOLD = GOLD-defence10price;
        DEFENCE = defence10attack;
    } }
}

    }
//</editor-fold>
//</editor-fold>
//<editor-fold defaultstate="collapsed" desc="BANK SYSTEM">
//<editor-fold defaultstate="collapsed" desc="WITHDRAW from bank">
void WITHDRAW(){
    BANKAMOUNT = Integer.valueOf(textField1.getString()).intValue();
                    if (BANKAMOUNT <= GOLD && BANKAMOUNT >= 0) {
                GOLD = GOLD-BANKAMOUNT;
                BANK = BANK+BANKAMOUNT;
stringItem1.setText(Integer.toString(BANK));
stringItem2.setText(Integer.toString(GOLD));
BANKAMOUNT = 0;
                    } else {
                        textField1.setString("error!");
                    }
}
//</editor-fold>
//<editor-fold defaultstate="collapsed" desc="DEPOSIT to bank">
void DEPOSIT(){
BANKAMOUNT = Integer.valueOf(textField1.getString()).intValue();
if (BANKAMOUNT <= BANK && BANKAMOUNT >= 0) {
GOLD = GOLD+BANKAMOUNT;
BANK = BANK-BANKAMOUNT;
stringItem1.setText(Integer.toString(BANK));
stringItem2.setText(Integer.toString(GOLD));
} else {
textField1.setString("error!");
}
}
//</editor-fold>
//</editor-fold>
//<editor-fold defaultstate="collapsed" desc="CHARACTER INFO">
void CHARINFO(){
    int list7num = 0;
    list7.insert(list7num, "HP = " + Integer.toString(HP), null);
    list7num++;
    list7.insert(list7num, "XP = " + Integer.toString(XP), null);
    list7num++;
    list7.insert(list7num, "XP NEEDED = " + Integer.toString(XPNEEDED), null);
    list7num++;
    list7.insert(list7num, "ATTACK = " + Integer.toString(ATTACK), null);
    list7num++;
    list7.insert(list7num, "DEFENCE = " + Integer.toString(DEFENCE), null);
    list7num++;
    list7.insert(list7num, "GOLD = " + Integer.toString(GOLD), null);
    list7num++;
    list7.insert(list7num, "BANK = " + Integer.toString(BANK), null);
    list7num++;
    list7.insert(list7num, "LVL = " + Integer.toString(LVL), null);
    list7num++;
    list7num = 0;
}
//</editor-fold>
void ROBB(){
    int num = 0;
    Random random = new Random();
    int CHANCE = random.nextInt(5);
    Random random1 = new Random();
    int GOLDget = random1.nextInt(200);
    if (CHANCE <= 4) {
       list.insert(num,"you failed to rob the bank you lost 5 hp", null);
       HP = HP-5;
    } else {
        list.insert(num,"you robbed the bank! you got " + Integer.toString(GOLDget) +" gold", null);
        GOLD = GOLD+GOLDget;
    }
}

}
